Home > DeveloperSection > Forums > using script tag in textbox.

Total Post:21

Posted on    August-24-2011 1:00 AM

 ASP.Net ASP.Net 

 2 Reply(s)
 2082  View(s)
Rate this:
problem in using script tag (or other html tag) in textbox and submit the page it gives the error as

A potentially dangerous Request.Form value was detected from the client (TextBox1="<script>").

how to solve this problem
give the solution of its

Chris Anderson
Chris Anderson

Total Post:65

Posted on    August-24-2011 1:06 AM

If you are using vs 2008:

write ValidateRequest="False" in the page directive.

For vs 2010:
write ValidateRequest="False" in the page directive,
and in web.config file
<httpRuntime requestValidationMode="2.0"/>



Amit Singh

Total Post:103

Posted on    August-24-2011 6:28 AM

Hi somesh

You can resolve this problem by using javascript escape function for textbox value then submit this value

Don't want to miss updates? Please click the below button!

Follow MindStick