How to avoid XSS Vulnerabilities in ASP.NET MVC ?

 Posted by Bharathi Cherukuri on 8/27/2012 | Category: ASP.NET MVC Interview questions | Views: 8917 | Points: 40
Answer:

To avoid xss vulnerabilities, you have to use the syntax as '<%: %>' in ASP.NET MVC instead of using the syntax as '<%= %>' in .net framework 4.0.
This is because it does the HTML encoding.

Example:

<input type="text" value="<%: value%>" />


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response