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
Post a Comment