从 ASP.NET WebForms 重定向到 MVC [英] Redirecting from ASP.NET WebForms to MVC

查看:38
本文介绍了从 ASP.NET WebForms 重定向到 MVC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个大型的现有 ASP.NET WebForms 应用程序,但我们现在正在转向 MVC.

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

与其经历痛苦的​​尝试将 MVC 集成到现有应用程序中的过程,我们还考虑创建一个全新的 VS 项目以完全隔离新代码.

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.

作为第一步,我们希望使用 WebForms 应用程序的现有登录过程,然后重定向到 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.

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

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.

非常感谢,

保罗

推荐答案

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

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.

这篇关于从 ASP.NET WebForms 重定向到 MVC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆