扩展html 无边框的input 边框
2016-03-23 17:29
696 查看
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);
}
}
{
/// <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);
}
}
相关文章推荐
- 自定义HTML中select控件
- 如何将pdf转换成html格式
- Doctype
- HTML锚点控制,跳转页面后定位到相应位置
- 使用illuminate/html
- 解决IE下select innerHTML无效的问题
- HTML网页基本标签:
- HTML空格占位符
- HTML转义字符工具类
- HTML网页禁止鼠标操作脚本
- HTML网页之打地鼠游戏
- HTML网页之坦克大战游戏
- HTML网页之俄罗斯方块
- Html.Action用法
- html中offsetTop、clientTop、scrollTop、offsetTop各属性介绍(转载)
- HTML标签整理
- html第五节课
- 修改innerHTML属性的问题
- 利用 html的锚点(元素a)功能实现ajax单页面应用的浏览器后退前进功能
- HTML网页版2048小游戏