开发者

How can I display an ASP.NET MVC html part from one application in another

We have several asp.net MVC apps in the following setup

SecurityApp (root application - handles forms auth for SSO and has a profile edit page)

Application1 (virtual directory)

Application2 (virtual directory)

Application3 (virtual directory)

so that domain.com points to SecurityApp and domain.com/Application1 etc point to their associated virtual directories. All of our Single Sign On (SSO) is working properly using forms authentication.

Based on the users permissions when logging in a menu that lists their available applications and a logout link will be generated and saved in the cache - this menu displays fine whenever the user is in the SecurityApp (editing their profile) but we cannot figure out how to get the Applications in the virtual directories to display the same application menu.

We have tried:

1) Using JSONP to do an request that will return the html for the menu. The ajax call returns the HTML with the html; however, because User.IsAuthenticated is false the menu comes back empty.

2) We created a user control and include it along with the dll's for the SecurityApp project and this works; however, we dont want to have to include all the dlls for the SecurityApp project in every application that we create (along with all the app settings in the web.config)

We would like this to be as simple as possible to implement so that anyone creating a new app c开发者_C百科an add the menu to their application in as few steps as possible... Any ideas?

To Clarify - we are using ASP.NET MVC 1.0 since these apps are in production and we do not have the okay to go to ASP.NET MVC 2.0 (unfortunately)


Have you thought about using Single Project Areas?

Areas allows you to partition your application into discrete areas of functionality. It helps make managing a large application more manageable and allows for creating distinct applets that you can drop into an overall application.

There is a version of Areas that works in MVC 1.0 available here: http://haacked.com/archive/2008/11/04/areas-in-aspnetmvc.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜