Change in ValidateRequest in ASP.NET 4.0

Posted by SheoNarayan under ASP.NET category on | Views : 8347
To submit any HTML contents through RichTextEditor in earlier version of ASP.NET (older than ASP.NET 4.0), we used to set ValidateRequest="false" in the Page directives of the aspx page and it used to work, however in the ASP.NET 4.0, by default request validation is true for all .aspx pages and cannot be set false from only .aspx page directives.

In ASP.NET 4.0, we need to add following tag into web.config file along with setting Page directives ValidateRequest=false in order to submit HTML contents
<httpRuntime requestValidationMode="2.0" />

Hope you find this useful.

Keep learning and sharing useful tips


Comments or Responses

Login to post response