如何找到SiteMap.RootNode.ChildNames
標題的值equel'test'在一行中? 我不寫linq它不起作用。找到子節點標題的文本是一個值
protected SiteMapNodeCollection getParentNodeTitle()
{
SiteMap.RootNode.ChildNames
}
如何找到SiteMap.RootNode.ChildNames
標題的值equel'test'在一行中? 我不寫linq它不起作用。找到子節點標題的文本是一個值
protected SiteMapNodeCollection getParentNodeTitle()
{
SiteMap.RootNode.ChildNames
}
這應該做的伎倆:
var mySiteMap = new SiteMap();
/* Lots of code for populating your SiteMap here */
var nodeTitledTest = mySiteMap.RootNode.ChildNodes.Where(x => x.Title == "test").FirstOrDefault();
這將返回的第一個節點等於「測試」或空標題,如果沒有這樣的節點可以找到。
「SiteMapNode」中沒有ChildNames。有'ChildNodes',另外。 – Candide