2015-12-19 18 views

回答

1

包括requestValidationMode在您的web.config文件。你

<system.web> 
    ... 
    <httpRuntime requestValidationMode="2.0" /> 
</system.web> 

也可以設置ValidateRequestfalse在你的頁面指令。

<%@ Page ... ValidateRequest="false" %> 
+1

第二種解決方案更好,因爲我希望它僅對管理頁面禁用。謝謝。 – Kosmos

+0

呵呵,第二種方法不起作用O_o我有這個'<%​​@ Page Language =「C#」ValidateRequest =「false」CodeFile =「include/functions.cs」Inherits =「_ Default」%>'空白頁面,當我嘗試添加一些html標籤到輸入。 – Kosmos

+0

第一種方法有效嗎? – Prabhat

相關問題