ASP.NET MVC 2 中的 DataAnnotationsModelBinder 问题
大家都尝试过mvc官网上的DataAnnotations教程吗?它对我不起作用。
当我尝试提交编辑后的产品时,出现以下错误消息:
找不到方法:“System.Collections.Generic.IDictionary`2 System.Web.Mvc.ModelBindingContext.get_ValueProvider()”。
我正在使用 ASP.NET MVC 2 预览版 2。您知道为什么会发生这种情况吗?我注册了他们需要的模型绑定器。
可能有人发现了一篇帖子或文章,其中包含如何使其发挥作用的指南?
Everybody tried out a tutorial on DataAnnotations from mvc official website? It didn't work for me.
When I'm trying to submit edited product, I have this error message:
Method not found: 'System.Collections.Generic.IDictionary`2 System.Web.Mvc.ModelBindingContext.get_ValueProvider()'.
I'm using ASP.NET MVC 2 preview 2. Any ideas why this happening? I registered model binder which they required.
May be someone came across a post or article that had a guide how to get this to work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
DataAnnotations 模型绑定器是 ASP.NET MVC 2 中的默认模型绑定器,您不必像教程中那样注册模型绑定器。因此,请删除注册模型绑定器的行。
另外,当您使用它时,您可能应该更新到 ASP.NET MVC 2 Beta 。
HTH,
查尔斯
The DataAnnotations model binder is the default model binder in ASP.NET MVC 2, you shouldn't have to register the model binder as it does in the tutorial. So remove the line where you register the model binder.
Also, while you're at it, you should probably update to the ASP.NET MVC 2 Beta.
HTHs,
Charles