An extension method that format an string and return a IHtmlString
public static class HtmlExtension
{
public static IHtmlString StringFormat<T>(this HtmlHelper<T> helper, string format, params object[] values)
{
return new HtmlString(string.Format(format, values));
}
}
Can be used like this:
<h1>@Html.StringFormat("View Invoice ({0}), Model.InvoiceNo )</h1>
Fork
0 Feedback
You must log in before you can give any feedback
You must log in before you can post a comment


1.38k
0




Mark 'aspmvc' tag as 'like'
Mark 'aspmvc' tag as 'ignore'