从ASP.NET WebForms重定向到MVC

时间:2023-01-21 03:22:15

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

我们有一个庞大的现有ASP.NET WebForms应用程序,但我们现在转向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.

我们正在考虑创建一个全新的VS项目以完全隔离新代码,而不是经历一个痛苦的尝试将MVC集成到现有应用程序中的过程。

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

作为第一步,我们希望使用WebForms应用程序的现有登录过程,然后重定向到MVC应用程序。

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.

有没有人知道一个简单的方法(即在同一个VS解决方案中从WebForms项目重定向到MVC项目)?到目前为止我发现的所有信息都表明要么从头开始在MVC中,要么将MVC结合到现有的Webforms项目中 - 这两者都不可行。

Many thanks,

非常感谢,

Paul

保罗

1 个解决方案

#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.

重定向是一个简单的部分:Response.Redirect(“http://domain.com/mvc/home/index”);.更困难的部分是在进程上设置单点登录,这样当用户在遗留应用程序上进行身份验证时,他将在新的MVC应用程序上自动进行身份验证。这是一篇很好的文章,介绍了如何在两个ASP.NET应用程序之间设置SSO场景。

#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.

重定向是一个简单的部分:Response.Redirect(“http://domain.com/mvc/home/index”);.更困难的部分是在进程上设置单点登录,这样当用户在遗留应用程序上进行身份验证时,他将在新的MVC应用程序上自动进行身份验证。这是一篇很好的文章,介绍了如何在两个ASP.NET应用程序之间设置SSO场景。