I have an ASP.NET Web Forms application. There is a page with TextBoxes and users enter search terms into these which are used to query the database.
I know that I need to prevent JavaScript injection attacks. How do I do this?
In MVC I would use Html.Encode
. It doesn't seem to be recognized in Web Forms.
Thanks!
You can use HttpUtility.HtmlEncode