MVC2 的 ASP.Net MVC Future 刷新
随着 MVC2 的发布,MVC Futures 库的更新包含哪些值得注意的功能?
With the release of MVC2, what noteworthy features are included in the refresh of the MVC Futures library?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
MVC Futures 有两个版本与 MVC 2 RTM 并存。其中一个版本针对 .NET 3.5;另一个目标是 .NET 4。(.NET 4 版本不是 .NET 3.5 版本的超集;如果您想要完整的功能范围,则必须将它们都包含在您的应用程序中。)从 http://aspnet.codeplex.com/releases/view/41742。
非详尽的功能列表 (.NET 3.5+):
诊断页面,可以帮助诊断运行时和程序集加载错误(请参阅文档)。
一个新的、更强大的模型绑定和验证系统。详细的文档和教程可在上面的链接中找到。
改进了对构建RESTful 服务的支持(请参阅 Microsoft.Web.Mvc.Resources 命名空间)。
强类型 ActionLink() 。
大量其他过滤器和帮助器,例如 Html.Serialize()(请参阅博客文章)、Html.Script() 等。
大量其他价值提供者,例如 JsonValueProviderFactory。
能够关闭各个控制器的会话状态,以提高站点的并行性(请参阅文档)。
针对 ASP.NET 4 的 MVC Futures 版本还包括:
具有部分输出缓存的能力,例如与页面的其余部分分开缓存 RenderAction() 的结果。< /p>
DynamicViewPage 允许您在 ViewPage 中使用真正的动态对象,比默认 ViewPage功能更全面。
能够使用DataAnnotations 4 属性。
远程验证、IClientValidatable(验证属性提供自己的客户端验证信息的能力)以及自定义非 DataAnnotations 属性贡献 ModelMetadata 的能力信息。
There are two versions of MVC Futures that sit alongside MVC 2 RTM. One version targets .NET 3.5; the other targets .NET 4. (The .NET 4 version is not a superset of the .NET 3.5 version; you must include both of them in your application if you want the entire range of functionality.) Download from http://aspnet.codeplex.com/releases/view/41742.
A non-exhaustive feature list (.NET 3.5+):
A diagnostics page which can help diagnose runtime and assembly loading errors (see documentation).
A new, more powerful model binding and validation system. Detailed documentation and a tutorial are available at the above link.
Improved support for building RESTful services (see the Microsoft.Web.Mvc.Resources namespace).
Strongly-typed ActionLink<T>().
A slew of other filters and helpers, such as Html.Serialize() (see blog post), Html.Script(), etc.
A slew of other value providers, such as JsonValueProviderFactory.
The ability to turn off Session State for individual controllers to increase parallelism in your site (see documentation).
The version of MVC Futures that targets ASP.NET 4 additionally includes:
The ability to have partial output caching, e.g. caching the result of a RenderAction() separately from the rest of the page.
DynamicViewPage allows you to use real dynamic objects in your ViewPage, somewhat more full-featured than the default ViewPage<dynamic>.
The ability to use DataAnnotations 4 attributes.
Remote validation, IClientValidatable (the ability of a validation attribute to supply its own client validation info), and the ability for custom non-DataAnnotations attributes to contribute to ModelMetadata information.
这里提供了 MVC3 Futures 的详细概述:
http://weblogs.asp.net/imranbaloch/archive/2011/07/26/using-the-features-of-asp-net-mvc-3-futures.aspx
A great overview of MVC3 Futures is available here:
http://weblogs.asp.net/imranbaloch/archive/2011/07/26/using-the-features-of-asp-net-mvc-3-futures.aspx