如何安装 ASP.NET MVC 2 Futures? [英] How do I install ASP.NET MVC 2 Futures?

查看:25
本文介绍了如何安装 ASP.NET MVC 2 Futures?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 DataAnnotations.DisplayAttribute.Order 属性在使用 DisplayForModelEditorForModel 方法.

<块引用>

相关问题:
是否DataAnnotations.DisplayAttribute.Order属性不适用于 ASP.NET MVC2?

我认为我需要使用 ASP.NET MVC 2 Futures.但我无法让它工作.

如何安装 ASP.NET MVC 2 Futures?

为什么我的字段仍然乱序?

解决方案

  1. 从 CodePlex 下载ASP.NET MVC 2 Futures.>

  2. 将其文件保存在文件系统中的某个位置:

    <块引用>

    C:\Program Files\MicrosoftASP.NET\ASP.NET MVC 2 Futures\

  3. 在项目中,右键单击引用并选择添加引用

  4. 浏览并选择文件 Microsoft.Web.Mvc.AspNet4.dll

  5. 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?

解决方案

  1. Download ASP.NET MVC 2 Futures from CodePlex.

  2. Save its files somewhere in the file system:

    C:\Program Files\Microsoft ASP.NET\ASP.NET MVC 2 Futures\

  3. In the project, right-click References and choose Add Reference

  4. Browse to and then select file Microsoft.Web.Mvc.AspNet4.dll

  5. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆