多个 ASP.NET 应用程序的集成

发布于 2024-11-02 14:40:02 字数 315 浏览 3 评论 0原文

我被要求设计一种解决方案来集成多个 ASP.NET 应用程序,其中一些应用程序很大,其中集成意味着:

  • 共享布局和 css
  • 通用页眉、页脚和菜单
  • 仅共享一个登录区域

我放弃在一个解决方案下加入应用程序,因为它们很大,将来可能会有更多应用程序,因此我正在考虑定义一个母版页或自定义控件,将其包含在每个应用程序的每个页面中。

该母版页或自定义控件将定义公共部分并控制访问安全性。

您觉得这个解决方案怎么样?其他(更好)的可能性? MasterPage 和自定义控件哪个更好?

谢谢

I've been asked to design a solution to integrate several ASP.NET applications, some of them are big, where integrations means:

  • Share layout and css
  • Common header, footer and menu
  • Share only one login area

I discard joining applications under one solution as they are big and in the future there may be more applications so I'm thinking of defining a MasterPage or Custom Control that will be included in EVERY page of every application.

This MasterPage or Custom Control will define the common parts and control the access security.

What do you think of this solution? Other (better) possibilities? What's better, MasterPage or Custom Control?

Thank you

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

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

发布评论

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

评论(2

阳光下的泡沫是彩色的 2024-11-09 14:40:02

母版页通常用于:

  1. 减少代码重复
  2. 减少脚本和 CSS 的重复 为引用
  3. 它的所有页面提供通用布局
  4. 提供执行逻辑的中心位置

您也可以在母版页上放置自定义控件,但对于您想要做的母版页是完美/唯一好的解决方案。

要共享单个登录区域,您可以创建一个不使用母版页的页面 (Login.aspx)。用户登录后,将其重定向到适当的页面。

为了控制访问,推荐的方法是使用表单身份验证和成员资格提供程序接口。角色成员资格提供程序将允许您将特定页面和代码路径限制为特定用户组(角色)。

Master Pages are generally used to:

  1. reduce duplication of code
  2. reduce duplication of script and css includes
  3. provide a common layout to all pages that reference it
  4. provide a central location to perform logic

You can put a custom control on a master page as well, but for what you want to do a master page is the perfect/only good solution.

To share a single login area you can create a page (Login.aspx) that doesn't use a master page. Once the user logs in, redirect them to the appropriate page.

To control access the recommended approach is to use forms authentication and the membership provider interface. The role membership provider will allow you to restrict specific pages and code paths to specific groups (roles) of users.

感情洁癖 2024-11-09 14:40:02

母版页可能有助于需要存在于外壳中的元素,在外壳中,内容可能源自用户控件,而用户控件源自正在集成的目标系统中的代码合并。

我可能会尝试实现一个用户控件,该控件可以在未修改的状态下调用原始系统。有点像实时屏幕抓取。然后通过将它们串在一起构建最终站点的原型版本,最终对结果进行回归测试(当您实际合并代码时)。

另一个完全不同的角度是将原始站点放入 iframe 中。

Master pages might help with elements that need to exist in a shell under a which the conents might be derived from user controls which are derived from the merging of code in the target systems being integrated.

I might try to implement a user control that that could make calls to the original systems in their unmodified states. A bit like screen scraping in real time. Then construct a proto-version of your final site by stringing them together, eventually regression testing against the result (when you actually merge code).

Another totally different angle would be to throw the original sites into iframes.

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