MVC 5.2 EditorFor HtmlAttributes停止工作

时间:2015-02-11 02:35:28

标签: asp.net-mvc asp.net-mvc-5.2

我不确定发生了什么变化但是我的编辑器上的htmlAttributes突然停止了工作。标签仍然有效,但不是EditorFor。如果我将它们更改为TextBox,则添加属性/类。

未添加的课程:

@Html.EditorFor(model => model.Address1, new { htmlAttributes = new { @class = "textboxXXLg k-textbox" } })

添加了类:

@Html.LabelFor(model => model.Address1, htmlAttributes: new { @class = "control-label ctrl-label required" })

我确认我正在使用MVC 5.2。

<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-5.2.0.0" newVersion="5.2.0.0" />

非常感谢任何帮助。

1 个答案:

答案 0 :(得分:3)

我想出来了。我添加了默认的Kendo编辑器模板,它们与EditorFor冲突。不知道为什么,我没有时间搞清楚。一旦我删除了Kendo模板,他们再次开始工作。