Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Request Validation

Reply
Thread Tools

Request Validation

 
 
John Comber
Guest
Posts: n/a
 
      11-03-2003
Hi,

I've a simple web form (webform1.aspx) with a text box &
button. The click event of the button appends the value
of the text box to the URL and redirects to
webform2.aspx. This then gets the value of the text box
from the query string.

I'd like to keep validateRequest=true to prevent malicious
input. If the user does enter some invalid text, is there
a way of catching the HttpRequestValidationException
before it bombs out to the browser? I would then like to
inform the user that their input is invalid.

Alternatively, if I set validateRequest=false, is there a
method to call (like
System.Web.HttpRequest.ValidateString) that will do this
so that I can catch any exceptions that are thrown?

Thanks in advance,

Regards
John.
 
Reply With Quote
 
 
 
 
MSFT
Guest
Posts: n/a
 
      11-04-2003
Hi John,

You try the Application_Error method in global.asax. Anyway, I think a
Validator control may be better in this situation. You can choose valid
user input on client side, so that we don't need to return to server; or
you can use Custome Validator to perform the validate on server side and
display proper message to customer. For more information for ASP.NET
validator control, you may refer to:

http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemwebuiwebcontrolsregularexpressionvalida torclasstopic.asp

http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfSystemWebUIWebControlsCustomValidatorClassTop ic.asp

Hope this help,

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET Web Forms Validation Controls are Server-Side or Client-Side Validation? Matt ASP .Net 14 01-30-2004 09:15 AM
Web form validation vs object validation Colin Basterfield ASP .Net 1 11-29-2003 12:10 AM
Re: Accessing Request.InputStream / Request.BinaryRead *as the request is occuring*: How??? Brian Birtle ASP .Net 2 10-16-2003 02:11 PM
validation summary doesnt display when there's client-side validation Libs ASP .Net 0 06-25-2003 03:05 PM
Re: only custom validation control does server side validation? Colin Mackay ASP .Net 0 06-25-2003 07:54 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57