c# - How to make HTML tag take effect automatically in mvc Razor View? -
i have following type of data stored in database field
<p>sdf'jsdfkl''jksdl;fj/ sdfjklf'' hiee</p> <p>&nbsp;</p> <p><strong>dfgdgdgfgsd</strong></p> <p><strong>fsfsfsf</strong></p> <p><strong>dfsfsdff</strong></p> <p>&nbsp;</p> <p><strong><img src="../scripts/tinymce/plugins/emoticons/img/smiley-cool.gif" alt="" /></strong></p> <p>&nbsp;</p> <p>hie text comes out texteditor.. 'sf'fsfdfs'df'f''""'"sdfsfskfkf/lfdjklsfj\jslfjklff</p>
i have stored in sql server in asp.net c# using httputility.htmlencode() method.
now want retrieve data database , want display without html tags..
for have used httputility.htmldecode(), decodes , generate tags , generated following result
<p>sdf'jsdfkl''jksdl;fj/ sdfjklf'' hiee</p> <p> </p> <p><strong>dfgdgdgfgsd</strong></p> <p><strong>fsfsfsf</strong></p> <p><strong>dfsfsdff</strong></p> <p> </p> <p><strong><img src="../scripts/tinymce/plugins/emoticons/img/smiley-cool.gif" alt="" /></strong></p> <p> </p> <p>hie text comes out texteditor.. 'sf'fsfdfs'df'f''""'"sdfsfskfkf/lfdjklsfj\jslfjklff</p>
i don't want display these tags, instead want display text, should do??
you can use html.raw()
on view or partial view display html.
html.raw("<div class=\"resource-row\">").tostring()
Comments
Post a Comment