Article ID: 821343 - Last Review: May 18, 2007 - Revision: 2.5 You receive an error message when you deploy an ASP.NET 1.0 application on a server with ASP.NET 1.1On This PageSYMPTOMSWhen you deploy a Microsoft ASP.NET 1.0 Web application on a
server with the Microsoft .NET Framework version 1.1 installed, you receive the
following error message if unencoded input is submitted : A potentially dangerous Request.Form value was detected from the
client CAUSEWhen the .NET Framework 1.1 is installed on a computer, the
default value of the validateRequest attribute is true. When the value of validateRequest is set to true, request validation is performed and an exception is thrown if
the input has potentially dangerous values. The new request validation feature in ASP.NET 1.1 proactively prevents attacks from dangerous values. It does not allow the server to process unencoded HTML content unless you decide to allow the content. The request validation feature is designed to help prevent some script-injection attacks where client script code or HTML can be unknowingly submitted to a server, can be stored, and then can be presented to other users. RESOLUTIONThe request validation feature of ASP.NET 1.1 prevents the
server from accepting content that contains unencoded HTML. You can disable
request validation by setting the validateRequest attribute to false in the @ Page directive or in the configuration section. Disable Request Validation on a PageTo disable request validation on a page, you must set the validateRequest attribute of the @ Page directive to false:Disable Request Validation for Your ApplicationTo disable request validation for your application, you must modify or create a Web.config file for your application and then set the validateRequest attribute of the <PAGES /> section to false:Note When request validation is disabled, content is submitted to your application. The application developer must make sure that the content is correctly encoded or is correctly processed. HTML Encode the ContentWhen request validation is disabled, you must HTML encode the content to prevent possible attacks by unencoded HTML content.If you have disabled request validation, it is good practice to HTML encode content that will be stored for future use. HTML encoding automatically replaces any "<" or ">" characters (and several other symbols) with their corresponding HTML encoded representation. You can easily HTML encode content on the server by using the Server.HtmlEncode(String) method. You can also easily HTML decode content. HTML decoding reverts HTML-encoded content back to standard HTML. To do this, use the Server.HtmlDecode(String) method. Use the following code: Microsoft Visual Basic. NET CodeMicrosoft Visual C# .NET CodeSTATUS This
behavior is by design. MORE INFORMATIONSteps to Reproduce the Behavior
REFERENCESFor more information, visit the following Microsoft Web
sites: Request Validation - Preventing Script Attacks http://www.asp.net/learn/whitepapers/request-validation/ (http://www.asp.net/learn/whitepapers/request-validation/) The <pages> Element http://msdn2.microsoft.com/en-us/library/950xf363(vs.71).aspx (http://msdn2.microsoft.com/en-us/library/950xf363(vs.71).aspx)
| Article Translations
|

Back to the top
