2011-12-08 42 views

回答

5

這是一個用於獲取給定頁面文件夾類型的頁面文件夾數據的小代碼示例。將類型Martin.MyPageFolder更改爲你的類型,它應該工作得很好。

using (DataConnection connection = new DataConnection()) 
{ 
    var pageFolderData = 
    from d in connection.Get<Martin.MyPageFolder>() 
    where d.PageId == SitemapNavigator.CurrentPageId 
    select d; 

    foreach (var item in pageFolderData) 
    { 
    // Use the item here as you need 
    }    
} 
+0

在VS中無法識別自定義類型,可能是因爲我將C1作爲WebApplication運行,並且生成的文件不會自動包含在項目中。類型被保存到哪裏? – magnattic

+0

該類型應該存在於Composite.Generated.dll中。你正在運行什麼版本的C1? –

+0

我錯過了對此dll的引用。現在,它的工作,非常感謝! – magnattic

相關問題