【发布时间】:2021-10-29 18:18:23
【问题描述】:
我将菜单链接保存在我的数据库中,格式为:“master/country”,master 是区域名称,country 是控制器名称。我的网址是 http://localhost/appname。当我单击国家菜单时,它会重定向到国家页面(http://localhost/appname/master/country)。但是当我再次单击 City 菜单项(也在主区域中)时,它会重定向到 http://localhost/appname/master/master/city。我在StringBuilder(包括标签)中编写菜单链接并将其存储在viewbag。
我尝试将菜单链接更改为“/master/country”,然后当我单击第一个菜单(国家/地区)时,URL 变为 http://localhost/master/country。
我正在使用 MVC 5。如何在同一区域内创建链接菜单?
【问题讨论】:
标签: c# asp.net-mvc