0
我使用MVC站點地圖提供用於創建一些麪包屑MvcSiteMapProvider與Razor視圖側獲取當前節點的父母
我想做的事;用剃刀
創建視圖上的麪包屑我想做些像調用下面顯示
<div id="navbar">
<div>YOU ARE HERE:
// There is no calls like this but you get the idea
@if (SiteMap.CurrentNode.HasParentNodes == true)
{
// I'd like to loop trough each parent till the RootNode
foreach (SiteMapNode Snode in SiteMap.CurrentNode.ParentNodes)
{
<a href="@Snode.Url">@Snode >></a>
}
} else {
// If there is no parent just show current node
<a href="@SiteMap.CurrentNode.Url.ToString()">@SiteMap.CurrentNode</a>
}
</div>
<div>@DateTime.Now.Date.ToLongDateString()</div>
</div>
所以,我怎麼能實現在此查看使用剃刀?