ASP.NET MVC - 区域或行政独立的Web应用程序? [英] ASP.NET MVC - Area or Separate Web Application for Administration?

查看:161
本文介绍了ASP.NET MVC - 区域或行政独立的Web应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

到现在为止,我一直在使用的 MVC区管理我的MVC应用的一部分,但最近我一直在反思这个的由于这样的事实,你不能有一个以上的配置每个应用程序的窗体身份验证

Up until now I've been using an MVC Area for the administration part of my mvc applications, but recently I've been rethinking this due to the fact that you can't have more than one configuration for forms authentication per application.

这已经成为最近的一个项目,我想设置AUTH的cookie不会过期,为用户监守一个问题,但我不wan't这对于管理用户。我也不想在用户登录页面将用于访问管理工具。

This has become a problem becuase in a recent project I wanted to set the auth cookies not to expire for users, but I don't wan't this for administration users. I also don't want the user login page to be used to access the admin tools.

我在考虑管理工具纯粹建立在解决方案中一个单独的MVC项目。这在我看来是最好的选择,但我不知道有关与部署的并发症。(目前我使用一个Web部署项目在VS2008管理版本)。

I'm considering setting up a seperate MVC project in the solution purely for admin tools. This seems to me the best option, but I'm wondering about complications with deployment. (Currently I'm using a Web Deployment Project in VS2008 to manage the build).

有谁目前使用的管理部分一个单独的MVC项目?任何陷阱?其他的意见,为什么这不是一个好主意?

感谢。

推荐答案

我一直在使用管理一个单独的网站。但就是这主要是因为我的网站管理是从使用完全不同的,因此需要不同的布局。

I'm always using a separate website for administration. But's it's primarily because the administration for my sites is totally different from the usage and therefore requires a different layout.

另一个积极的事情是,你不必怀疑,如果用户可能能够修改的东西,他们不应该能够修改,因为这些部件没有内置到用户的网站。

Another positive thing is that you don't have to wonder if users might be able to modify stuff that they shouldn't be able to modify since those parts are not built into the user web site.

更新

我的意思是布局,剃刀或与母版视图web表单引擎。

I mean Layout with Razor or Masterpage with webforms view engine.

我们使用 http://admin.domainname.com 并的 http://www.domainname.com 分离的站点。很容易设置。

We use http://admin.domainname.com and http://www.domainname.com to separate the sites. Quite easy to setup.

分离该网站还使得控制器和视图更清洁了很多,因为他们只办理要么管理员或用户的任务。不需要很多的IFS(否则可以很容易,如果你像我一样添加=懒codeR:)

Seperating the sites also makes the controllers and views a lot cleaner since they only handle tasks for either administrators or users. No need for a lot of ifs (which otherwise can be very easy to add if you are like me = a lazy coder :)

这篇关于ASP.NET MVC - 区域或行政独立的Web应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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