首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

asp.net mvc 中 Html.EditorFor 怎么添加 htmlattribute 属性 小弟我想把 @Html.EditorFor(mode

2012-04-15 
asp.net mvc 中 Html.EditorFor 如何添加 htmlattribute 属性我想把@Html.EditorFor(modelasp.net mvc 中

asp.net mvc 中 Html.EditorFor 如何添加 htmlattribute 属性 我想把 @Html.EditorFor(model
asp.net mvc 中 Html.EditorFor 如何添加 htmlattribute 属性

我想把 @Html.EditorFor(model => model.Email) 在页面上生成只读的.就是添加:readonly="readonly"的html属性啊.

[解决办法]

C# code
<%= Html.TextBoxFor(model => model.Property, new { disabled="disabled", @readonly = "readonly" })%>
[解决办法]
探讨

C# code
<%= Html.TextBoxFor(model => model.Property, new { disabled="disabled", @readonly = "readonly" })%>

[解决办法]
@foreach(Person p in Model)
 {
@Html.TextBox("PersonName", p.Name, new { @readonly="readonly"})
 }
[解决办法]
探讨

引用:

引用:

C# code
<%= Html.TextBoxFor(model => model.Property, new { disabled="disabled", @readonly = "readonly" })%>
在MVC中是这样的


Html.EditorFor 可以这么使用么?

热点排行