I'm currently using MVC 3 (WebForm view engine) and have a form that shows user comments.
If I have a comment which has an ampersand (&), <%= Html.Textbox() %>
will encode it as &
. However, if the form is then posted to the server, ASP.NET kicks in thinking that the submitted content is malicious.
I find myself having to use HTML decoding methods using JavaScript before the content is sent to the server.
I am able to get the results that I want, but I feel like I'm not doing this right.
Any suggestions?