By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,373 Members | 1,763 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,373 IT Pros & Developers. It's quick & easy.

@Page validateRequest And UserControls

P: n/a
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.
Nov 18 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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.

"Ray Williams" <an*******@discussions.microsoft.com> wrote in message
news:C8**********************************@microsof t.com...
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.

Nov 18 '05 #2

P: n/a
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

"Ray Williams" <an*******@discussions.microsoft.com> wrote in message
news:C8**********************************@microsof t.com..
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.


Nov 18 '05 #3

P: n/a
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.
Nov 18 '05 #4

P: n/a
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.
"Ray Williams" <an*******@discussions.microsoft.com> wrote in message
news:1D**********************************@microsof t.com...
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.

Nov 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.