Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTML tags in textbox causes ValidateRequest exception

Status
Not open for further replies.

IT4EVR

Programmer
Feb 15, 2006
462
US
On a web form I have a text box and when someone enters html tags in the text box, it throws the infamous exception:

System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client

One "fix" is to set ValidateRequest to false in the page or config file, but I am not really interested in opening up my code to scripting attacks. The best approach would be to disallow html tags from text boxes.

What are some other approaches?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top