views:

175

answers:

1

Hi there,

We have a large existing ASP.NET WebForms application, but we are now moving over to MVC.

Rather than go through a painful process of trying to integrate MVC into the existing app, we're looking at creating a brand new VS project to completely isolate the new code.

As a first step, we are wanting to use the existing login process of the WebForms app, then redirect over to the MVC app.

Does anyone know of an easy way to do this (i.e. redirect from a WebForms project to the MVC project, in the same VS solution)? All the information I've found so far suggests either starting from scratch in MVC, or combing MVC into the existing Webforms project - neither of which is very feasible.

Many thanks,

Paul

+1  A: 

Redirecting is the easy part: Response.Redirect("http://domain.com/mvc/home/index");. The more difficult part would be to set up a single sign on process so that when a user is authenticated on the legacy application he would be automatically authenticated on the new MVC application. Here's a nice article covering how to setup a SSO scenario between two ASP.NET applications.

Darin Dimitrov
Thanks for the quick reply Darin. Rather than hard-coding the URL, do you know if there is a way of programatically referencing the MVC project?My MVC project is literally called "MVC" - is there a way of firing up the default route from within WebForms?Many thanks,Paul
Paul Gordon
No, there isn't. You have two separate applications hosted on separate virtual directories in IIS. So you need to hardcode somewhere in the WebForms application the address of the MVC application.
Darin Dimitrov