4 个控制器之间的 asp.net mvc 2 菜单

发布于 2024-08-18 20:42:43 字数 207 浏览 3 评论 0原文

我想要 2 个导航菜单 - 其中一个是“顶级”菜单,有 4 个选项,每个选项都指向一个单独控制器的索引。

我希望在屏幕左侧有一个“控制器级”子菜单。这将对应于与顶部菜单中选择的控制器相关的链接。

“控制器级”菜单不是静态的,需要根据用户的角色进行定制。

顶层是基本的。但是,如何创建当从顶部选择控制器时会发生变化的第二个菜单?

丹克!

I want to have 2 navigation menus- One will be a "Top Level" menu, with 4 choices, each pointing to the index of a separate controller.

I would like to have a "Controller-Level" sub-menu on the left of my screen. This will correspond to links relevant to the controller selected in the top menu.

The "controller-level" menu is not static and needs to be customized based on roles of user.

The top-level one is basic. But how can i create the second menu that will change when a controller is selected from top?

danke!

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

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

发布评论

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

评论(2

遗忘曾经 2024-08-25 20:42:43

我正在处理类似的情况,我需要两个菜单。这里是否已经解决了“最佳实践”?我需要在左侧有一个菜单,在顶部有一个动态创建的类似选项卡的菜单,具体取决于我正在使用的页面。

用户实际上需要能够根据偏好添加/删除/隐藏顶部选项卡。我们正在使用 MVC 2,我不确定选项卡栏是否属于控件、单个视图或什么......以及如何使它们与我的页面交互。 (左侧导航需要始终显示用户所在位置,顶部选项卡需要根据用户选择的子页面突出显示。

I'm working on a similar situation where I need two menus. Was a "best-practice" ever resolved here? I have the need for one menu on the left, and a dynamically created tab-like menu at the top depending on what page I'm working with/on.

The user actually needs the ability to add/remove/hide top tabs depending on preferences. We are using MVC 2 and I'm not sure if the tab bar belongs in a control, on individual views, or what...and also how to make them both interact with my pages. (The left nav needs to show where the user is at all times, and the top tab needs to be highlighted based on the sub-page the user has selected.

桃扇骨 2024-08-25 20:42:43

如果您使用的是 MVC 2 RC 或 MVC Futures,请使用 RenderAction

为动态菜单创建一个控制器,并调用 RenderAction("action", "controller")。这将调用控制器,您可以在控制器中使用逻辑来显示正确的菜单。

If you are using MVC 2 RC or MVC Futures, then use RenderAction.

Create a controller for the dynamic menu, and call RenderAction("action", "controller"). This will invoke the controller, and you can have your logic in the controller to show the correct menu.

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