When using ActionLink to render data from database which has HTML tags
(ie <p>)
incorporated in it, ActionLink escapes the tags. What is the best way to handle this?
When using ActionLink to render data from database which has HTML tags
(ie <p>)
incorporated in it, ActionLink escapes the tags. What is the best way to handle this?
I don't know that you can turn off the XSS protection in the helper methods, but you can always build your own helper methods. Just make an extension method that hangs off the Html class.
If you just want to render some HTML from the database, you can use <%= ViewData["MyContent"] %> if you're controller loads the data into the MyContent view data. Just know that you have to clean this HTML yourself.
In valid (X)HTML, paragraph tags are disallowed inside of anchor tags, so I wouldn't expect the framework to allow it.