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

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? :

Great article!
I also posted a tutorial at www.KYNOU.com about DataList control in asp.net
Go to www.KYNOU.com and search for: DataList Control
There is also a chat room where I try to spend a lot of time answering questions. Stop by if you want.
:)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.