ValidateRequest except..

  • Thread starter Thread starter Raterus
  • Start date Start date
R

Raterus

I'm assuming the answer to this is a big "NO", but is it possible to disable validation checks for a particular control, instead of setting ValidateRequest=False in the page directive?

--Michael
 
yeah just disable the validation control associated with that control you do
not want checked.

ValidationControl.Enabled = false;

that is if you meant from server side. dont think there is any way to
disable them from clientside... though disabling javascript should do the
job


hope that answers your question,

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
I'm assuming the answer to this is a big "NO", but is it possible to disable
validation checks for a particular control, instead of setting
ValidateRequest=False in the page directive?

--Michael
 
Michael,

I don't think so, since it's a page level directive. What's worse is there's
no way to smartly intercept this error either because it fires before your
code gets control, so even if you capture the exception there's nowhere to
return to...

The thing to do is turn it off on pages where it gets in the way and then
make very sure you validate the input where required.

+++ Rick ---

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/weblog/
http://www.west-wind.com/wwThreads/
----------------------------------
Making waves on the Web


I'm assuming the answer to this is a big "NO", but is it possible to disable
validation checks for a particular control, instead of setting
ValidateRequest=False in the page directive?

--Michael
 
There is a CausesValidation property on button controls and such that you
can set to false if you don't want it to trigger validation.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net


I'm assuming the answer to this is a big "NO", but is it possible to disable
validation checks for a particular control, instead of setting
ValidateRequest=False in the page directive?

--Michael
 
Not using the built-in features of ASP.NET. You will have to turn to a third
party solution or write one yourself. I just released "Visual Input
Security" which is an advanced set of tools to detect and block SQL
Injection, script injection, input tampering and brute force attacks. It
includes validators where you can determine just how much is validated on a
control-by-control basis. For example, some will fully block script
injection, others will allow it (knowing that you will also HtmlEncode),
others will block only a list of undesirable HTML tags that you define.
Details are at http://www.peterblum.com/vise/home.aspx.

--- Peter Blum
www.PeterBlum.com
Email: (e-mail address removed)
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

I'm assuming the answer to this is a big "NO", but is it possible to disable
validation checks for a particular control, instead of setting
ValidateRequest=False in the page directive?

--Michael
 
Back
Top