0

Hey guys,

I'm using VS .NET 2003, and I am designing a web application in VB .NET, I'm just wondering, Tekmaven mentioned to me in another thread of mine that it would be a good idea to use the datalist control as a menu, how would I use it to get menu's much the same as those on this site, or any control for that matter.

Thanks again guys,

Slade

3
Contributors
2
Replies
3
Views
13 Years
Discussion Span
Last Post by LeProgrammeur
0

Umm, that is a kind of a wide open question you have asked. confused:

Here is some code to get you started:

<asp:DataList id="dlMenu" runat="server" .....
....
....
OnItemCommand="dlMenu_ItemCommand"
....>

....
<ItemTemplate>
<asp:LinkButton id="btnItem1" runat="server" Text='<%Container.DataItem("MenuValue1")%' CommandName="select" /></ItemTemplate>
</asp:DataList>

Now in the Code behind or Script Code place

public sub dlMenu_ItemCommand(obj as Object, e as DataListCommandEventArgs)
dlMenu.SelectedIndex = e.Item.ItemIndex
'    |||||    Do what you want with the selected Item . Navigate, etc
end sub

Hope this helps.... Maybe Tekmaven has something to add to this? :

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.