using script tag in textbox.

Total Post:21

Points:147

 2785  View(s)
Ratings:
Rate this:
hi,
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
thanks,
  1. Re: using script tag in textbox.

    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

     <system.web>
    <httpRuntime requestValidationMode="2.0"/>
    </system.web>

     

     

      Modified On Mar-29-2018 04:25:27 AM
  1. Re: using script tag in textbox.

    Hi somesh

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

Answer

Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.