Reputation: 207
Is use of AntiXss library necessary/recommended in mvc 3 razor application? Where can I find out more about encoding options for mvc 3?
Upvotes: 4
Views: 1066
Reputation: 1400
Razor automatically encodes the output to prevent XSS. If you need to output HTML mark-up then you can use the @Html.Raw(myVariable)
method or make sure the variables you need to not be encoded are of type HtmlString
.
Upvotes: 3