ASP.NET MVC3, Html.TextAreaFor without encoding?

前端 未结 3 1446
走了就别回头了
走了就别回头了 2021-01-12 17:15

How can I use the Html.TextAreaForwithout encoding it? I know it\'s a security risk but I have a separate class that sanitizes any text.

Example:

@Html.TextA

3条回答
  •  情歌与酒
    2021-01-12 17:35

    You will need to roll your own:

    
    

    Of course in terms of security this could be very dangerous as your site is now vulnerable to XSS attacks. So the question is why having a separate class that sanitizes all the text when you can simply rely on the HTML helpers to do the job for you?

提交回复
热议问题