Hi,
This is reply to an email conversation between support and I earlier
Here is what I am trying to do. I try to use the slide menu control to dynamically display numerous notes from a data lookup.
I was planning to create a new menu item and one submenu and one custom item “on the fly” for each record, with an embedded asp label control on each submenu where I could display the text. My first approach didn’t seemed to be working, so my first question: would it be possible to use the control at all this way?
Hi Steve,
The only place you can access a CustomItem created that way is by handling ItemDataBound event. Inside that event you can then use:
e.CustomItem.FindControl("lblNote1").Text = "something";
We are switching from email based support to forum based support. So if you have any more questions, it would be highly appreciated if you can post it in the forum.
Thanks
-----Original Message-----
Subject: Embedded label control
Hi,
I'm trying to embed an asp label control to my slide menu. The page
seems to be OK, but the control do not get rendered and access it from
code behind is generating the "Object reference not set to an instance
of an object." error.
What am I doing wrong? Could someone help me?
Thanks
Sincerely,
Steve Komaromi
Network Administrator, Systems Developer
Business Risk Partners, Inc.
Tel: 1-(860)-903-0039
Here is the aspx code segment.
-
<div style="OVERFLOW: auto; WIDTH: 530px; HEIGHT: 340px">
<asp:panel id="pnlACNotesViewer" runat="server">
<AspxLab:SlideMenu id="smACNotesViewer" runat="server" Width="100%"
MenuSkinID="None" SlidePaneHeight="130">
<ItemLooks>
<aspxlab:MenuItem ItemID="_TopGroup">
<SubMenu Style-CssText="PADDING-RIGHT: 5px; PADDING-LEFT: 5px;
FONT-WEIGHT: bold; FONT-SIZE: 11px; PADDING-BOTTOM: 5px; CURSOR: hand;
PADDING-TOP: 5px; FONT-FAMILY: tahoma; BACKGROUND-COLOR: #6b7dde"
LeftIconCellWidth="13" ItemSpacing="15"></SubMenu>
</aspxlab:MenuItem>
<aspxlab:MenuItem Height="25"
HoverStyle-CssText="background-image:url("00000002");color:#42
8EFF;"
ItemID="_TopLevelItem"
NormalStyle-CssText="background-image:url("00000001");color:#2
15DC6;"
SelectedStyle-CssText="background-image:url("00000003");color:
#215DC6;">
<SubMenu Style-CssText="BORDER-TOP-WIDTH: 1px; BORDER-RIGHT:
white 1px solid; PADDING-RIGHT: 2px; PADDING-LEFT: 13px; FONT-SIZE:
11px; FONT-WEIGHT: normal; PADDING-BOTTOM: 9px; BORDER-LEFT: white 1px
solid; CURSOR: hand; COLOR: #215dc6; BORDER-TOP-COLOR: white;
PADDING-TOP: 9px; BORDER-BOTTOM: white 1px solid; FONT-FAMILY: tahoma;
BACKGROUND-COLOR: #d6dff7"
LeftIconCellWidth="19" ItemSpacing="5"></SubMenu>
</aspxlab:MenuItem>
<aspxlab:MenuItem HoverStyle-CssText="COLOR: #428eff;
TEXT-DECORATION: underline" ItemID="_Default"
NormalStyle-CssText="color:#215DC6;"></aspxlab:MenuItem>
</ItemLooks>
<TopGroup Orientation="Vertical">
<Items>
<aspxlab:MenuItem Text-Html="No Agent Company notes found">
<SubMenu>
<TemplateItem>
<CustomItem HorizontalAlign="Center">
<asp:Label ID="lblNote1" Runat="server"
Width="510"></asp:Label>
</CustomItem>
</TemplateItem>
</SubMenu>
</aspxlab:MenuItem>
</Items>
</TopGroup>
</AspxLab:SlideMenu>
</asp:panel>
</div>
-------------------------------------------------------------------------
Thanks
Steve Komaromi
Computer Systems Manager, Lead Developer
Business Risk Partners, Inc.
Tel: 1-(860)-903-0039