开发者

Error "A potentially dangerous Request.Form value was detected from the client" despite the fixes for ASP.NET MVC 2?

Using ASP.NET 4.0 and MVC 2, I have added these开发者_开发问答 suggested modifications:

In the web.config -

<httpRuntime requestValidationMode="2.0"/>

To the Controller -

 <ValidateInput(False), AcceptVerbs(HttpVerbs.Post)>

To the View Page -

   <%@ Page ValidateRequest="false" %>

I still receive the exception

A potentially dangerous Request.Form value was detected from the client

I am trying to use the MarkItUp editor in this way -

<%= Html.TextAreaFor( model => model.Description,"markitup")%>


A work around for this issue is to set the validation mode to v2.0 instead of v4.0. To do this, add this httpRuntime line to your web.config, inside System.Web, along with using the <ValidateInput(false)> attribute

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

I haven't found the reason yet, but this worked for me.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜