Why is EditorFor in my ASP.NET MVC 2 application throwing ArgumentNullException?

那年仲夏 提交于 2019-12-02 09:55:07

What does the Editor template look like for the property you are passing? (I assume x.Name is a string, so you should have a template called String.ascx in Views/Shared/EditorTemplates).

It likely the editor template that is getting loaded for string does not like a null string being passed.

If you don't have a custom editor template for string (and all you want is a basic textbox), then there is no reason to use EditorFor.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!