MvcContrib.Mvc3-ci 3.0.75.0 重大变化?
刚刚从 MvcContrib.Mvc3-ci 3.0.73.0 更新到 3.0.75,之前工作的普通 ViewUserControl 引发了运行时异常:
The model item passed into the dictionary is of type 'System.String', but this dictionary requires a model item of type 'MvcContrib.UI.InputBuilder.Views.PropertyViewModel`1[System.Object]'.
“有问题的”编辑器从模型中获取了一个普通字符串:
<%: Html.EditorFor(m => m.Model.NEV) %>
恢复到 3.0.73.0,并且编辑器可以工作再次。有什么想法吗? (3.0.74.0 似乎也可以工作)
Just updated from MvcContrib.Mvc3-ci 3.0.73.0 to 3.0.75, and the previously working plain ViewUserControl threw a runtime exception:
The model item passed into the dictionary is of type 'System.String', but this dictionary requires a model item of type 'MvcContrib.UI.InputBuilder.Views.PropertyViewModel`1[System.Object]'.
The "offending" editor takes a plain string from the model:
<%: Html.EditorFor(m => m.Model.NEV) %>
Reverting to 3.0.73.0, and the editor works again. Any ideas? (3.0.74.0 also seems to be working)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我遇到了同样的问题并解决了它恢复到版本:3.0.73.0
I had the same issue to and solved it be reverting to version: 3.0.73.0
我遇到了同样的错误。看来,如果您使用 EditorFor 以外的任何东西,它都可以正常工作。
因此,如果您知道需要呈现哪个 HTML 编辑器,请使用它(例如 @Html.TextAreaFor(x => x.Model.NEV)
I ran into the same error. It seems that if you use anything other than EditorFor it works fine.
So if you know which HTML editor needs to be rendered use that (e.g. @Html.TextAreaFor(x => x.Model.NEV)