0

How to render html Tag in model property in MVC. I have a collection of model name game, i have a property name description which have some html tags.

I want to render the html tag of the property along with description, currently it consider the html tag as text.

My Code

List<Game> gameList = new List<Game>();

gameList.Add(new Game() { GameId = 3,  GameDescription = @"GTA 3, it's working 100 percent.

<br/>

I love gaming and Gta San Andreas is one of my favourite game. 
<strong>Compressed Gta San Andreas</strong>

or after download leave a comment on below section." });

I have a strongly type view bind wit the model Game

   <div class="col-sm-8 text-left">
                @foreach (var game in Model)
                {

                            <p style="height:200px">
                                @game.GameDescription
                            </p>

                }

            </div>
John Doe
  • 141
  • 1
  • 2
  • 10
  • `@Html.Raw(game.GameDescription)` –  Dec 10 '17 at 06:36
  • it's hard to check every title before question, title of the question should be specific, asking question on stackoverflow required effort. – John Doe Dec 10 '17 at 06:43

0 Answers0