Wednesday, December 26, 2012

A potentially dangerous Request. Form value was detected from the client (MVC3) How to Solve

A potentially dangerous Request. Form value was detected from the client (MVC3) How to Solve
Add this in Global.asax.cs
protected void Application_Start()
{
      GlobalFilters.Filters.Add(new ValidateInputAttribute(false));
}

Add this in Web.config Under <system.web>

<httpRuntime  requestValidationMode="2.0" />

<pages validateRequest="false">

See Sample Image