A
alexandis
I have menu bound to sitemap file.
This is a piece of code
<asp:menu ... >
<StaticItemTemplate>
<%# ((MenuItem)Container.DataItem).Selected ? [Show 'selected'-styled
decoration] : [Show plain-styled decoration] %>
</StaticItemTemplate>
</asp:menu>
I check properties of menu items in my method and based on it decide,
which element should be shown selected.
The problem is when I try to determine this before databinding event,
menu still does not have items and impossible to find out, what should
be selected. When I try to determine this AFTER databinding, it's too
late, because <StaticItemTemplate> already rendered and element is
shown unselected
This is a piece of code
<asp:menu ... >
<StaticItemTemplate>
<%# ((MenuItem)Container.DataItem).Selected ? [Show 'selected'-styled
decoration] : [Show plain-styled decoration] %>
</StaticItemTemplate>
</asp:menu>
I check properties of menu items in my method and based on it decide,
which element should be shown selected.
The problem is when I try to determine this before databinding event,
menu still does not have items and impossible to find out, what should
be selected. When I try to determine this AFTER databinding, it's too
late, because <StaticItemTemplate> already rendered and element is
shown unselected