在 Umbraco 中做一个项目,在一个案例中我遇到了问题,在调用 node.NiceUrl 时我得到了 # 作为结果。奇怪的是,如果我以某种方式调试它,它会解析为正确的 url。
var pages = Pages.Select((item, index) => new
{
Url = item.NiceUrl,
Selected = item.Id == currentPage.Id,
Index = index
}).ToList();
从哪里获得页面:
CurrentPage.Parent.ChildrenAsList
最佳答案
如果我这样做,它会起作用,但我不知道为什么。
Url = new Node(item.Id).NiceUrl,
关于c# - 在 Umbraco 中调用 node.NiceUrl 给我 #,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5829542/