扩展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);
}
}

posted @   骚年丶勿忘初心。  阅读(523)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示