Sunday, April 24, 2011

ERROR: A potentially dangerous Request.Form value was detected from the client in ASP.NET

This occurs when we try to post html code. The server will validate the postdata, if it find that its an HTML code, error something similar to this is shown. This actually helps to prevent running  malicious script. If you really want to post the html content add this to the page directive validateRequest=”false”. 

 <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login" ValidateRequest="false" %>


You can also do this from the web.config like this

<pages  validateRequest="false" />

No comments:

Post a Comment

Ajax CalendarExtender displaying at wrong position in Chrome

< script type ="text/javascript" language ="javascript">     function onCalendarShown(sender, args)...