Click here to Skip to main content
14,924,138 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Can someone help me remove special characters from my textbox so that it will no longer throw a error code such as this one

{HttpRequestValidationException (0x80004005): A potentially dangerous Request.Form value was detected from the client (tb1="").]
First, where is your code sample which causes this problem? Please understand that now, during a season of vacations, my access to your hard drive is somewhat limited. :-)
And what do you call the "special characters"?
Alby3k 9-Jul-12 17:35pm
I am currently using no code to strip special characters, that is why I am getting the error message. I consider special characters to be like "<>+&%". I understand that regex would probably be the best method, but I have yet been able to get it to work for me.
[no name] 9-Jul-12 17:39pm
Maybe you should investigate the String.Remove() method.
Alby3k 9-Jul-12 17:42pm
I'm very new to programming, could you give me an example as to how I would use it to control a standard textbox on a webform in VB.
SoMad 9-Jul-12 19:30pm
I believe Wes suggests you use String.Remove()[^] on the string before you put the string into your textbox.

Soren Madsen

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900