Using the Datalist Control as a Menu

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Mar 2004
Posts: 634
Reputation: Slade has a spectacular aura about Slade has a spectacular aura about 
Solved Threads: 7
Slade's Avatar
Slade Slade is offline Offline
Practically a Master Poster

Using the Datalist Control as a Menu

 
0
  #1
May 1st, 2004
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
Formerly known as Slade.
Reply With Quote Quick reply to this message  
Join Date: Feb 2003
Posts: 793
Reputation: Paladine has a spectacular aura about Paladine has a spectacular aura about Paladine has a spectacular aura about 
Solved Threads: 26
Team Colleague
Paladine's Avatar
Paladine Paladine is offline Offline
Master Poster

Re: Using the Datalist Control as a Menu

 
0
  #2
May 8th, 2004
Umm, that is a kind of a wide open question you have asked. confused:

Here is some code to get you started:

  1. <asp:DataList id="dlMenu" runat="server" .....
  2. ....
  3. ....
  4. OnItemCommand="dlMenu_ItemCommand"
  5. ....>
  6.  
  7. ....
  8. <ItemTemplate>
  9. <asp:LinkButton id="btnItem1" runat="server" Text='<%Container.DataItem("MenuValue1")%' CommandName="select" /></ItemTemplate>
  10. </asp:DataList>


Now in the Code behind or Script Code place

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

Hope this helps.... Maybe Tekmaven has something to add to this? :
Assistant Manager, Pharmacy Informatics
Wordpress Learning Blog
Updated : ASP.Net Login Code
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 5
Reputation: LeProgrammeur is an unknown quantity at this point 
Solved Threads: 0
LeProgrammeur LeProgrammeur is offline Offline
Newbie Poster

Re: Using the Datalist Control as a Menu

 
0
  #3
Jun 11th, 2006
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC