如何安装ASP.NET MVC 2期货? [英] How do I install ASP.NET MVC 2 Futures?
问题描述
我想使用 DataAnnotations.DisplayAttribute.Order 财产使用时要安排我的领域<一个href=\"http://msdn.microsoft.com/en-us/library/system.web.mvc.html.displayextensions.displayformodel.aspx\"相对=nofollow> DisplayForModel 和<一个href=\"http://msdn.microsoft.com/en-us/library/system.web.mvc.html.editorextensions.editorformodel%28v=VS.100%29.aspx\"相对=nofollow> EditorForModel 方法。
相关问题:结果
<一href=\"http://stackoverflow.com/questions/2837952/does-the-dataannotations-displayattribute-order-property-not-work-with-asp-net-mv\">Does该
DataAnnotations.DisplayAttribute.Order
财产不能与ASP.NET MVC工作
2?
块引用>我想我需要使用 ASP.NET MVC 2期货。但我不能得到它的工作。
如何安装ASP.NET MVC 2期货?
为什么我的领域还乱序?
解决方案
ASP.NET MVC 2期货从$ C $ CPLEX。
地方在文件系统中保存的文件:
C:\\ Program Files文件\\微软
ASP.NET \\ ASP.NET MVC 2期货\\
块引用>在项目中,右键点击参考并选择添加引用
浏览,然后选择文件的 Microsoft.Web.Mvc.AspNet4.dll
注册模型中的元数据提供商的的Global.asax.cs
保护无效的Application_Start()
{
...
ModelMetadataProviders.Current =新DataAnnotations4ModelMetadataProvider();
DataAnnotations4ModelValidatorProvider.RegisterProvider();
}
I want to use the DataAnnotations.DisplayAttribute.Order property to arrange my fields when using the DisplayForModel and EditorForModel methods.
Related question:
Does the DataAnnotations.DisplayAttribute.Order property not work with ASP.NET MVC 2?I think that I need to use the ASP.NET MVC 2 Futures. But I can't get it to work.
How do I install ASP.NET MVC 2 Futures?
Why are my fields still out of order?
解决方案
Download ASP.NET MVC 2 Futures from CodePlex.
Save its files somewhere in the file system:
C:\Program Files\Microsoft ASP.NET\ASP.NET MVC 2 Futures\
In the project, right-click References and choose Add Reference
Browse to and then select file Microsoft.Web.Mvc.AspNet4.dll
Register the model metadata provider in Global.asax.cs:
protected void Application_Start() { ... ModelMetadataProviders.Current = new DataAnnotations4ModelMetadataProvider(); DataAnnotations4ModelValidatorProvider.RegisterProvider(); }
这篇关于如何安装ASP.NET MVC 2期货?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!