@Page validateRequest And UserControls

G

Guest

I have a specific page that I have chosen to disable the .NET 1.1 validateRequest options by setting the page directive attribute of "validateRequest" from true to false. I manually validate all controls within this page. This page includes a UserControl which contains a textbox. It appears that the validateRequest attribute is not propagated to the usercontrol when the page is processed. This results in the standard "potentially dangerous" error being thrown, even though this process should be disabled for the entire form

I have not been able to locate an attribute for disabling client input validation against controls found in a UserControl. Shouldn't the validateRequest setting for the hosting page propagate to the UserControl

I have seen option for performing client side javascript HtmlEncoding to prevent this error. However, I need a more passive option that does not require the user to trigger the validation themselves.
 
A

avnrao

It works. i did a sample pro on it. created a user control with a text box
and added it in a page.
enabled validateRequest : gave an error.
disabled vaidateRequest : typed object tag in user control text box. it
doesnt validate.

Av.
 
G

Guest

Av. - Thanks for the quick reply. I just finished creating a new web application in an attempt to reproduce the error as well. Unfortunately, I was unable to duplicate my error in the new app. However, I still receive the "potentially dangerous" error message in my original application. I just checked my code again and I indeed have the validateRequest attibute set to false. Can you think of any other reason that this error would appear if the attribute is set to false

Thanks
Ra

----- avnrao wrote: ----

It works. i did a sample pro on it. created a user control with a text box
and added it in a page
enabled validateRequest : gave an error
disabled vaidateRequest : typed object tag in user control text box. it
doesnt validate

Av
 
G

Guest

Av. - I modified my web.config to include the following section
<location path="Directory1/Directory1a/WebPage.aspx"><system.web><pages validateRequest="false"/></system.web></location
Everything seems to be working correctly now
Thanks for your help.
 
A

avnrao

thats cool. i think now you can remove this code from web.config and put
back your @Page attribute. it will work i guess.

Av.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,739
Latest member
Clint8040

Latest Threads

Top