Redirecting from ASP.NET WebForms to MVC(从 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:从 ASP.NET WebForms 重定向到 MVC


基础教程推荐
- 使用 SED 在 XML 标签之间提取值 2022-01-01
- C# - 将浮点数转换为整数...并根据余数更改整数 2022-01-01
- C# - 如何列出发布到 ASPX 页面的变量名称和值 2022-01-01
- Page.OnAppearing 中的 Xamarin.Forms Page.DisplayAlert 2022-01-01
- 覆盖 Json.Net 中的默认原始类型处理 2022-01-01
- 从 VB6 迁移到 .NET/.NET Core 的最佳策略或工具 2022-01-01
- 如何使用OpenXML SDK将Excel转换为CSV? 2022-01-01
- 当键值未知时反序列化 JSON 2022-01-01
- 我什么时候应该使用 GC.SuppressFinalize()? 2022-01-01
- 创建属性设置器委托 2022-01-01