Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Re: How to handle "A potentially dangerous Request.Form value wasdetected from the client"

Reply
Thread Tools

Re: How to handle "A potentially dangerous Request.Form value wasdetected from the client"

 
 
Larry Bud
Guest
Posts: n/a
 
      01-06-2009
On Dec 29 2008, 7:49*pm, Alan Silver <alan-
(E-Mail Removed)> wrote:
> Hello,
>
> I know why the "A potentially dangerous Request.Form value was detected
> from the client" error happens, and I know it can be avoided by setting
> validateRequest to false, but is there a way of handling the error
> rather than disabling it?
>
> I have a form where I don't want people to be able to enter HTML, but I
> don't want to show this ugly error if they do. I would like to be able
> to catch the error and handle it myself by encoding the user's input,
> rendering the HTML harmless.
>
> Any ideas? Thanks,
> Alan
>
> --
> Alan Silver
> (anything added below this line is nothing to do with me)


You can handle it in the page. Override the OnError sub

Protected Overrides Sub OnError(ByVal e As System.EventArgs)
'handle the error here. You may want to check the error msg because
this will trap all errors.
context.clearerror()

End Sub
 
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
A potentially dangerous Request.QueryString value was detected from the client Hardy Wang ASP .Net 7 04-23-2011 02:02 PM
Re: How to handle "A potentially dangerous Request.Form value wasdetected from the client" ZRat ASP .Net 0 01-05-2009 02:52 PM
how to try-catch potentially dangerous Request.Form value exception angus ASP .Net 1 08-04-2004 09:48 AM
Trapping a ' potentially dangerous Request.QueryString value' John Morgan ASP .Net 1 05-27-2004 06:11 PM
A potentially dangerous Request.Form value was detected from the client amit ASP .Net 1 02-26-2004 09:47 PM



Advertisments