如何在同一域中混合使用两个 ASP.NET 项目:用于后端的 WebForms 和用于前端的 MVC?

发布于 2024-10-04 22:39:59 字数 203 浏览 0 评论 0原文

我们正在开发一个应用程序,并希望将其分成两个项目。最终用户的第一个项目将在 asp.net mvc 上,第二个用于管理的项目将在 asp.net webforms 上,因为简单的增删改查操作在 webform 上执行起来更容易,并且有许多开箱即用的控件。问题:

  1. 通过 site.com/backend共享相同的身份验证系统
  2. 访问后端

We are developing an application and want to separate it into two projects. The first project for end users will be on asp.net mvc, and the second for administration will be on asp.net webforms because simple crud operations perform easier on webforms and there are many out of the box controls. Problems:

  1. share same authentication system
  2. access to backend via site.com/backend

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

上课铃就是安魂曲 2024-10-11 22:40:00

小菜一碟。

  1. 身份验证的支柱是 Asp.net 核心的一部分。 MVC 和 WebForms 共享 FormsAuthentication cookie 和成员资格提供程序< /a>

  2. WebForms 和 MVC 相处得很好。您真正需要做的就是在 global.asax 中为您的 /backend/ 子目录设置 routes.RouteExistingFiles = true; ,MVC 不会尝试将您的 WebFormPages.aspx 路由到控制器。

Piece of cake.

  1. The backbone of Authentication is part of Asp.net's core. MVC and WebForms share things like the FormsAuthentication cookies and Membership Providers

  2. WebForms and MVC get along just fine. All you really need to do is set routes.RouteExistingFiles = true; in global.asax for your /backend/ subdirectory and MVC won't try and route your WebFormPages.aspx to Controllers.

彩扇题诗 2024-10-11 22:40:00

因为简单的增删改查操作在网络表单上执行起来更容易

我根本不同意这一点。除非您要使用我不推荐的 SQLdatasource,否则您也会遇到同样的问题。 nHibernate 和 EntityFramework 为 Webform 和 MVC 提供了一个很好的数据访问解决方案

这里是我如何实现单点登录的链接,两个 asp.net 项目指向相同的成员资格架构。

cause simple crud operations performs easer on webforms

I don't agree with this at all. You have the same problems with either or unless you're going to use SQLdatasource which I don't recommend. nHibernate and EntityFramework provide a nice data access solution for both webforms and mvc

Here is a link to how I achieved Single Sign On, two asp.net projects pointing to the same membership schema.

洒一地阳光 2024-10-11 22:40:00

为什么 Web 表单上的增删改查操作更容易?我认为 MVC 更适合开箱即用的 CRUD 操作。还可以尝试 jquery 控件,因为它们比内置的 ASP.NET 控件更好。

Why are crud operations easier on webforms? MVC in my opinion is better for crud operations out of the box. Also try jquery controls, as they are better than the built in ASP.NET controls.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文