How would you do to display rendered html code like this <b>short article</b> and display it as bold short articl
in an ASP.net mvc 3 view ?
I tried out @System.Web.HttpUtility.HtmlDecode(item.short_article); but doesn’ t work
thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use HtmlHelper.Raw. It will return markup that is not HTML encoded.
You need to be aware however of the security risks when outputting HTML like this. If a user enters some HTML code that contains Javascript and save it to the database, your page will render and execute this script.
If there is a risk of users entering malicious data for your short_article field you should strip their input based on a whitelist of tags you want to allow.