Pronunciation / adjective
Bringing something good and unforseen.
    Skip Navigation Links > Code Repository
   

Allow HTML/XML Code to be submitted in v1.1 of the Dot.Net framework



 
Return

Allow HTML/XML Code to be submitted in v1.1 of the Dot.Net framework

In ASP.Net if code is entered into a text box and posted back a security exception is thrown.
This feature may be turned off in one of two ways:

1. In the web config file.
2. On a per page basis from the .aspx page itself.

To turn off request validation for all pages in an application add the following code to the web.config file (Please note that xml is case sensitive):
  1. <pages validateRequest="false" />


To turn off request validation on a page by page basis add the following code to the page directive:
  1. validateRequest=false


(Please note that there is a bug in the v1.1 Dot.Net framework. If quotes are used in the above line of code as in the sample below an error will occur.)

This works:
  1. <%@ Page Language="vb" validateRequest=false AutoEventWireup="false" Codebehind="default.aspx.vb" Inherits="AboutFortunate._default1" smartNavigation="True"%>


This does not:
  1. <%@ Page Language="vb" validateRequest="false" AutoEventWireup="false" Codebehind="default.aspx.vb" Inherits="AboutFortunate._default1" smartNavigation="True"%>


Return
Microsoft Certified Professional   © 2018 Fortunate.  All rights reserved.
contact: justin@aboutfortunate.com