📅  最后修改于: 2022-03-11 14:49:12.787000             🧑  作者: Mango
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() );
}
}