📜  在 cs 中调用 Textboxfor - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:12.787000             🧑  作者: Mango

代码示例1
public static class CustomHtmlHelper {

    public static MvcHtmlString MyFieldBox(this HtmlHelper html, Expression> expression, String title) {

        StringBuilder sb = new StringBuilder();
        sb.AppendLine("
"); sb.AppendLine("
\"); sb.AppendLine("", title); sb.AppendLine("
"); sb.AppendLine( htmlHelper.TextBoxFor( expression, new { @class = "form-control inline-input" }) ); sb.AppendLine("
"); sb.AppendLine( htmlHelper.ValidationMessageFor( expression ); sb.AppendLine("
"); return new MvcHtmlString( sb.ToString() ); } }