扩展html 无边框的input 边框


public static class HtmlHelper
{
/// <summary>
/// 返回没有边框的只读的TextBox标签
/// </summary>
/// <typeparam name="TModel"></typeparam>
/// <typeparam name="TValue"></typeparam>
/// <param name="html"></param>
/// <param name="expression"></param>
/// <returns></returns>
public static MvcHtmlString EditorReadFor<TModel, TValue>(this HtmlHelper<TModel> html, Expression<Func<TModel, TValue>> expression)
{
string format = null;
object htmlAttributes = new
{
@readonly = "readonly",
@style = "border:none"
};
return html.TextBoxFor(expression, format, htmlAttributes);
}
}

原文地址:https://www.cnblogs.com/louby/p/5312058.html