2011-03-07 93 views
1

我收到此錯誤有潛在危險的Request.Form值

A potentially dangerous Request.Form value was detected from the client (ctl00$ContentPlaceHolder1$txtEmbed="<embed src='http://a...").

當我打開的鏈接按鈕點擊代碼中modalpopup擴展後面我正在分配文本

value="<embed src='http://auddia.com/player-viral.swf' height='20' width='200' allowscriptaccess='always' flashvars='volume=100&autostart=false&file=http://auddia.com/Audios/audioStream_1299222864888_19.flv&plugins=viral-1d'/> 

並且我還在頁面指令中設置了ValidateRequest="false"。在代碼後面我也使用HttpUtility.HtmlEncode。但一次又一次我面對這個錯誤

"A potentially dangerous Request.Form value was detected from the client (ctl00$ContentPlaceHolder1$txtEmbed="<embed src='http://a...").".

請幫我儘快。

+0

什麼txtEmbed的是造成這種價值? – 2011-03-07 06:45:59

+1

@Stecya:世界上所有的附加信息都來自哪裏?很多您編輯的東西都不在原始問題中。 – 2011-03-07 07:07:36

+0

可能的重複[從客戶端檢測到潛在危險的Request.Form值](http://stackoverflow.com/questions/81991/a-potentially-dangerous-request-form-value-was-detected-from-the - 客戶端) – Barmar 2013-01-08 17:10:35

回答

3

嘗試添加到您的web.config。

<configuration> 
    <system.web> 
    <httpRuntime requestValidationMode="2.0" /> 
    </system.web> 
</configuration> 
+0

另一種選擇是編寫自定義驗證器解釋[這裏](http://msmvps.com/blogs/luisabreu/archive/2010/01/05/oh-gosh-validating-user-input-is-extensible。 ASPX) – Adeel 2011-03-07 07:05:34

0
<system.web> 
    <httpRuntime requestValidationMode="2.0" /> 
</system.web> 
相關問題