Label Html helper is show up as string literal <label...> contents instead of being rendered
Q: How do I get this to render as a ? It' showing up as string literal text instead of being renderd into an actual element.
public static class HtmlExtensions
{
public static string LabelX(this HtmlHelper htmlHelper,
string target, string text, string _class)
{
return (String.Format开发者_开发知识库( "<label class='{2}' for='{0}'>{1}</label>", target, text, _class);
}
}
Return an MvcString not a regular string.
精彩评论