タブをレンダリングするための 3 つのネストされたリピーターの構造があり、それらのタブの下に、見出しでグループ化された多数の項目があります。.NET 4.5 の厳密に型指定されたデータ コントロールを標準型でうまく使用してきましたが、.NET を使用するのはIEnumerable
これが初めてDictionary<T1,T2>
です。それにもかかわらず、別のStackoverflow の質問で、 asを宣言することで aDictionary
を正常に使用しているのを見てきました。DataSource
ItemType
KeyValuePair<T1, T2>
マークアップ:
<asp:Repeater ID="rptTabs" runat="server"
ItemType="System.Collections.Generic.KeyValuePair<System.String, System.Collections.Generic.Dictionary<System.String, System.Collections.Generic.List<Sitecore.Data.Items.Item>>>">
<ItemTemplate>
<%# Item.Key %>
<%-- ... more repeaters under but they are commented out for now as it's the outer on that is failing --%>
</ItemTemplate>
</asp:Repeater>
コードビハインド:
var myDatasource = new Dictionary<string, Dictionary<string, List<Item>>>();
// add some items
rptTabs.DataSource = myDatasource;
rptTabs.DataBind();
これが私が得ている例外/スタックトレースです:
string
ItemType を名前で解決できないため、ページを作成できないように見えます。問題は、私は自分でインテリセンスを取得する<%# Item.Key #%>
ので、インテリセンス エンジンは文字列名で型を解決できますが、ランタイムは解決できませんか?
注: Sitecore.Data.Items.Item
ItemType がSitecore.Data.Items.Item
.
どんな助けでも大歓迎です!