【发布时间】:2014-07-26 11:24:21
【问题描述】:
我想为这个 url 添加 MvcSiteMapProvider 节点:
.../AdminsArea/Orders?type=20
我将此行添加到 mvc.sitemap ,但它没有显示任何面包屑。
<mvcSiteMapNode title="Orders" area="AdminsArea" controller="Home" action="Index">
<mvcSiteMapNode title="OrderStuff" area="AdminsArea" controller="Orders" action="Index" preservedRouteParameters="type" id="10" />
<mvcSiteMapNode title="OrderGroup" area="AdminsArea" controller="Orders" action="Index" preservedRouteParameters="type" id="20"/>
</mvcSiteMapNode>
我该怎么办? 谢谢。
控制器:
公共类 OrdersController : 控制器
{ public ActionResult Index(short type) { ///some codes... return View(myOrder); } }
【问题讨论】:
-
请分享你的控制器..
-
@KartikeyaKhosla 我现在添加了我的控制器。
-
type 的值为 null???
-
@KartikeyaKhosla 不,它正在获得价值。我想防止为不同类型创建两个表单。
-
我没有得到你@mortazavi 你想用类型做什么??
标签: asp.net-mvc asp.net-mvc-4 sitemap url-parameters mvcsitemapprovider