Reputation: 1962
In my database there is html tags , such as
Hello <br/> world
And I use the following code in my view to display this data:
<span> @Table.text </span>
but the problem is that the data is displayed with break line , it is displayed as Hello world
And the same problem happen for any other html tags such as <a> tag
or <img> tag
.
In other words, I want to display the data from database as it is without any change.
How can I solve this problem ?
Upvotes: 0
Views: 536
Reputation: 7650
Try this:
@Html.Raw("Hello <br/> world".Replace("<br/>",""))
Upvotes: 1