对于ASP.NET MVC方面的最佳实践 [英] Best practices for ASP.NET MVC areas

查看:152
本文介绍了对于ASP.NET MVC方面的最佳实践的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在建设一个CMS系统,我需要有一个简单的方法包含或排除组件。

I'm currently building a CMS system, and I need to have an easy way include or exclude components.

我首先想到的是使用asp.net的MVC区功能,以确定自身的每个组件。

My first think was to use asp.net mvc area feature, to identified each component on itself.

但是,从我看到的,区域功能有<一个href=\"http://stackoverflow.com/questions/2270861/set-default-area-avoiding-new-area-on-each-link-on-the-site\">problems,所以也许这不是好主意。

But from what I see, the area feature has problems, so maybe it not that good idea.

推荐答案

与区域功能的一些经验之后,我认为区域是最好的东西在你的网站完全不同,不是与根区域共享相同的母版页

After a few experience with area feature, I think that areas are best for something entirely different in your site, that not share the same master page with the root area.

在我的情况下,组件是一个附加组件来根网站,并共享相同的母版页,这不是最好的做法是使用领域。

In my case, that components are an add-ons to the root site, and share the same master page, it not best practice to use areas.

这篇关于对于ASP.NET MVC方面的最佳实践的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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