我让数据库中输入数据时~只要内容喊有html标签~如<html>,<table>等等~就报错~
报错内容如下:
Server Error in '/房产网' Application.
--------------------------------------------------------------------------------A potentially dangerous Request.Form value was detected from the client (nr=" <html>"). 
Description: Request Validation has detected a potentially dangerous client input value, and processing of the request has been aborted. This value may indicate an attempt to compromise the security of your application, such as a cross-site scripting attack. You can disable request validation by setting validateRequest=false in the Page directive or in the configuration section. However, it is strongly recommended that your application explicitly check all inputs in this case. Exception Details: System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client (nr=" <html>").在线跪等答案~拜托了各位~

解决方案 »

  1.   

    <%@ Page language="c#" Codebehind="xxx.aspx.cs" AutoEventWireup="false" Inherits="xxxx.xxx"   validateRequest="false"%>
    或者 webconfig
    <pages validateRequest="false"></pages>
      

  2.   

    <%@ Page language="c#" Codebehind="xxx.aspx.cs" AutoEventWireup="false" Inherits="xxxx.xxx"   validateRequest="false"%>
    或者 webconfig
    <pages validateRequest="false"></pages>
      

  3.   

    SQL Server2000
    我用的是HtmlEncode啊,这样neirong=Server.HtmlEncode(nr.Text);但还是没用~内容里有<html>标签的话还是出错!!!
      

  4.   

    在<%@Page%>里加validateRequest="false"
      

  5.   

    谢谢了sunjay117() ,viena(维也纳nn-收回潜望镜,下潜50米)和alex0917() 的答案~按照你们的方法问题已经解决了!!!十分感谢!!!激动落泪~好人啊好人~真是太感谢了!
      

  6.   

    //我用的是HtmlEncode啊,这样neirong=Server.HtmlEncode(nr.Text);但还是没用
    在你用到这个方法之前,已经出错了
      

  7.   

    Click the link to solve your problem.Good luck!