0

If the text input is between 'greater Than' and 'less than' symbol, I am unable to save the text. Kindly find a solution to this either in Javascript or ASP.net

Steve Holland
  • 619
  • 1
  • 12
  • 29
Sachin
  • 21
  • 6
  • 2
    Possible duplicate of ["<" in a text box in ASP.NET --> how to allow it?](http://stackoverflow.com/questions/4146309/in-a-text-box-in-asp-net-how-to-allow-it) – xanatos Feb 19 '16 at 08:58
  • 1
    This has nothing to do with Classic ASP. – Paul Feb 19 '16 at 09:39
  • Please suggest me: I need to show validation only if some text is entered in between < and >. Rest of the cases should be accepted by the browser. Suggest a solution without security concern. – Sachin Feb 23 '16 at 10:31

2 Answers2

0

Such symbols are forbidden for security reasons - otherwise someone can simply inject their code. If you need to pass such symbols you should pass them like this : "/<" "/>" Or Set TextBox attribute ValidateRequestMode = ValidateRequestMode.Disabled

S. Nadezhnyy
  • 582
  • 2
  • 6
0

If you want to allow HTML tags i.e "<>" then you need to set validateRequest="false" in ASP pages , best thing is to parse those tags using HTML encoder .

Rakesh Bk
  • 112
  • 15