gpt4 book ai didi

c# - 在 Umbraco 中调用 node.NiceUrl 给我 #

转载 作者:太空狗 更新时间:2023-10-29 22:54:56 26 4
gpt4 key购买 nike

在 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com