In ASP.NET unable to save TextBoxes if the text is

2019-09-10 07:02发布

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

2条回答
家丑人穷心不美
2楼-- · 2019-09-10 07:11

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

查看更多
Explosion°爆炸
3楼-- · 2019-09-10 07:12

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 .

查看更多
登录 后发表回答