如何安装 ASP.NET MVC 2 Futures? [英] How do I install ASP.NET MVC 2 Futures?
问题描述
我想使用 DataAnnotations.DisplayAttribute.Order 属性在使用 DisplayForModel 和 EditorForModel 方法.
<块引用>相关问题:
是否DataAnnotations.DisplayAttribute.Order属性不适用于 ASP.NET MVC2?
我认为我需要使用 ASP.NET MVC 2 Futures.但我无法让它工作.
如何安装 ASP.NET MVC 2 Futures?
为什么我的字段仍然乱序?
从 CodePlex 下载ASP.NET MVC 2 Futures.>
将其文件保存在文件系统中的某个位置:
<块引用>C:\Program Files\MicrosoftASP.NET\ASP.NET MVC 2 Futures\
在项目中,右键单击引用并选择添加引用
浏览并选择文件 Microsoft.Web.Mvc.AspNet4.dll
在 Global.asax.cs 中注册模型元数据提供者:
protected void Application_Start(){...ModelMetadataProviders.Current = new 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 Futures?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!