n this tutorial I will show you that how can you how can we render html tags in the string in MVC3 razor.
Example of the string is
string abc = “this is htmlstring”;
this can be rendered in razor using html.raw tag now after launching of the MVC3 RC2 that means you dont have to use
@MvcHtmlString.Create(ViewBag.HtmlOutput)
or
@(new HtmlString(ViewBag.HtmlOutput))
or anything else to output a string containing HTML in ASP.NET MVC.
So tag can be written as ….
@html.raw(abc);
This will render your html tag.
string abc = "this is <b>html</b>string"; @html.raw(abc);
This is how we can render html tags in MVC3 razor
No comments:
Post a Comment