开发者

string <br/> to HTML

In my aSP.NET MVC model, I build a string, the result of this string is :

"MyName1 <br/> MyName2 <br/> MyName3"

I'd like see in my HTML page the result like this : MyNAme1开发者_如何学Go MyName2 MyName3

and not the stirng

"MyName1 <br/> MyName2 <br/> MyName3"

How can I do this ?

Thanks,


The key is outputting the string without HTML encoding. If you are using the Razor view engine:

@Html.Raw(Model.MyString)

And if you're using the WebForms view engine:

<%= Model.MyString %>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜