9

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 Answer 1

5

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.

3
  • 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 Mar 15, 2010 at 11:21
  • 1
    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. Mar 15, 2010 at 11:49
  • After all these years there is a solution for msdn.microsoft.com/en-us/library/vstudio/…
    – mko
    Sep 13, 2014 at 12:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.