Subsonic retuns me a menucollection object how do i map it to asp.net menu control
MenuCollection muc = new MenuCollection(); muc.Load(SPs.UspGetUserM开发者_如何学JAVAenu(Context.User.Identity.Name).GetReader());
how do i map it to the menu control in Asp.net
If the menu control has a datasource property:
MenuCollection muc = new MenuCollection();
muc.Load(SPs.UspGetUserMenu(Context.User.Identity.Name).GetReader());
MyMenu.DataSource = muc;
MyMenu.DataBind();
EDIT: My idea was wrong. You can't just pass a subsonic collection to a menu datasource. This related question shows that you need to implement the IHierarchyData interface.
精彩评论