c# - Display string as html in asp.net mvc view -


i have controller generate string containing html markups.now when displaying on views, displayed simple string containing tags. tried use html helper encode/decode display properly, not working.

string str= "<a href="/home/profile/seeker">seeker</a> has applied <a href="/jobs/details/9">job</a> floated you.</br>"; 

on views,

@html.encode(str) 

you close want use @html.raw(str)

@html.encode takes strings , ensures special characters handled properly. these include characters spaces.


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -