Im working in Asp.net 2.0 and Ajax 1.0
Im getting error while post back the page if any input control(textBox) has value &#
im not getting error even it has value #&
Hi ajith P T
The “&#” is a special word in HTML, it might be forbid during the postback because of the security issue.
If you need this in your TextBox, you can set the ValidateRequest="false" on your <%@ Page %> tag to avoid the error.
Just like the following demo:
<%@ Page Language="C#" ValidateRequest="false" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> </script> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> </div> <asp:Button ID="Button1" runat="server" Text="Button" /> </form> </body> </html>
Microsoft Online Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
You can disable request validation by setting the validateRequest attribute in the @ Page directive to false, as shown in the following example:
<%@ Page validateRequest="false" %>
To disable request validation for your application, you must modify or create a Web.config file for your application and set the validateRequest attribute of the pages section to false, as shown in the following example:
<configuration> <system.web> <pages validateRequest="false" /> </system.web> </configuration>
This Indicates whether request validation should occur. If true, request validation checks all input data against a hard-coded list of potentially dangerous values. If a match occurs, an HttpRequestValidationException exception is thrown. The default is true.
This feature is enabled in the machine configuration file (Machine.config). You can disable it in your application configuration file (Web.config) or on the page by setting this attribute to false.
Approva Systems Pvt Ltd,