天天看點

錯誤解決:[A potentially dangerous Request.Form value was detected from the client]

錯誤提示:

從用戶端(textbox1="<!doctype htmlpubli...")中檢測到有潛在危險的 request.form 值。

a potentially dangerous request.form value was detected from theclient (txttest="<b>").由于在.net中,request時出現有html或javascript等字元串時,系統會認為是危險性值。立馬報錯。

解決方案一:

在.aspx檔案頭中加入這句:

<%@ page validaterequest="false" 

%>

解決方案二:

修改web.config檔案:

<configuration>

  <system.web>

   <pages validaterequest="false"/>

 </system.web>

</configuration>

因為validaterequest預設值為true。隻要設為false即可。

繼續閱讀