I am trying to display a TempData list with an HTML flag inside. Is it possible to interpret ballistics and not only display it?
This is a sample code to illustrate what I want.
Controller:
List<string> ls = new List<string>(); ls.Add("<div> First div </div>"); ls.Add("<div> Another div </div>"); ls.Add("<div> Another div again </div>"); TempData.Add("ModelLs", ls);
View:
var ls = (List<string>)TempData["ModelLs"]; foreach (string str in ls) { @str }
And I would like to display 3 "real" divs on my page (and not 3 "<div> .... </div>" ). How can i do this?
source share