asp.net-mvc – Asp.net MVC TextArea
发布时间:2020-05-23 11:05:45 所属栏目:asp.Net 来源:互联网
导读:如何确定TextArea的大小并在Asp.net Mvc中为其分配模型值 尝试这个: %=Html.TextAreaFor( m = m.Description, 15, 20, new RouteValueDictionary(new { @class = someClass}))% 编辑: 这不会工作,据我所知 %=Html.TextAreaFor
|
如何确定TextArea的大小并在Asp.net Mvc中为其分配模型值 解决方法尝试这个:<%=Html.TextAreaFor(
m => m.Description,15,20,new RouteValueDictionary(new { @class = "someClass"}))%>
编辑: <%=Html.TextAreaFor(m => m.Description,new { cols = "20",rows = "15" })%>
因为这个: private const int TextAreaRows = 2;
private const int TextAreaColumns = 20;
// ...
public static string TextArea(
this HtmlHelper htmlHelper,string name,IDictionary<string,object> htmlAttributes) {
Dictionary<string,object> implicitAttributes = new Dictionary<string,object>();
implicitAttributes.Add("rows",TextAreaRows.ToString(CultureInfo.InvariantCulture));
implicitAttributes.Add("cols",TextAreaColumns.ToString(CultureInfo.InvariantCulture));
return TextAreaHelper(htmlHelper,name,true /* useViewData */,null /* value */,implicitAttributes,null /* explicitParameters */,htmlAttributes);
} (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- asp.net-identity – 保护整个ASP.NET 5 MVC 6应用程序
- asp.net:如何在button onclick上使用eventargs进行参数传递
- 为什么在发送到asp.net web方法之前jquery不将我的数组转换
- 将额外的信息与ASP.NET MVC成员关联
- ASP.NET MVC 3 Ajax.BeginForm和Html.TextBoxFor不反映在服
- asp.net – 如何禁用通过IIS提供的单页面应用程序HTML文件的
- asp.net-mvc – Sitecore MVC – 如何在页面上处理多个表单
- asp.net-mvc – 使用ASP.NET MVC导出数据到Excel文件4 C#正
- asp.net-mvc – 将javascript对象作为字典传输到控制器操作
- asp.net – 使用ASPNet_Regiis加密自定义配置部分 – 你能做
推荐文章
站长推荐
- asp.net-mvc – 将Castle Windsor与SignalR集成
- ASP.NET MVC 3 Razor – jQuery Intellisense
- asp.net – 如何从TableAdapter中检索存储过程返
- asp.net – 在将其上传到服务器之前,在客户端进行
- 如何在ASP.NET MVC4项目之间共享HTML
- ASP.NET会员密码重置
- .net – MVC 5中的“CacheProfile”
- asp.net-mvc-4 – 为什么ResolveBundleUrl不能用
- asp.net – DropDownList OnSelectedIndexChange
- ASP.Net身份注销
热点阅读
