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

Posted by Frank Sessions on Stack Overflow See other posts from Stack Overflow or by Frank Sessions
Published on 2010-02-04T01:49:15Z Indexed on 2010/05/01 20:07 UTC
Read the original article Hit count: 312

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 can 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)

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about mvc