Ahmed Shamel
Ahmed Shamel

Reputation: 1962

Display data from database without being effected by html tags

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

Answers (1)

asdf_enel_hak
asdf_enel_hak

Reputation: 7650

Try this:

@Html.Raw("Hello <br/> world".Replace("<br/>",""))

Upvotes: 1

Related Questions