开发者

Label Html helper is show up as string literal <label...> contents instead of being rendered

开发者 https://www.devze.com 2023-04-10 10:46 出处:网络
Q:How do I get this to render as a ?It\' showing up as string literal text instead of being renderd into an actualelement.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消