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

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

问题描述

我想使用 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期货?

为什么我的领域还乱序?


解决方案

  1. ASP.NET MVC 2期货从$ C $ CPLEX。


  2. 地方在文件系统中保存的文件:


      

    C:\\ Program Files文件\\微软
      ASP.NET \\ ASP.NET MVC 2期货\\



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


  4. 浏览,然后选择文件的 Microsoft.Web.Mvc.AspNet4.dll


  5. 注册模型中的元数据提供商的的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?

解决方案

  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期货?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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