943,673 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 10047
  • ASP.NET RSS
May 1st, 2004
0

Using the Datalist Control as a Menu

Expand Post »
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
Similar Threads
Reputation Points: 115
Solved Threads: 7
Practically a Master Poster
Slade is offline Offline
633 posts
since Mar 2004
May 8th, 2004
0

Re: Using the Datalist Control as a Menu

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

Here is some code to get you started:

ASP.NET Syntax (Toggle Plain Text)
  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

ASP.NET Syntax (Toggle Plain Text)
  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? :
Team Colleague
Reputation Points: 211
Solved Threads: 27
Master Poster
Paladine is offline Offline
793 posts
since Feb 2003
Jun 11th, 2006
0

Re: Using the Datalist Control as a Menu

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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
LeProgrammeur is offline Offline
5 posts
since Jun 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: Limitation
Next Thread in ASP.NET Forum Timeline: E-mail not working





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC