Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Building a menu with hyperlinks

Status
Not open for further replies.

emozley

Technical User
Jan 14, 2003
769
GB
Hi,

I have a table in my database that contains an id and a Title field.

id | Title
----------
1 Golf
2 Football
3 Rugby

I want to list all the records but displayed in a table which is going to be my left hand menu. Each item on my menu needs to be a hyperlink which contains the id as well as the title eg:

Code:
<a href="showinfo.asp?ID=1">Golf</a>
<br>
<a href="showinfo.asp?ID=2">Football</a>
<br>
<a href="showinfo.asp?ID=3">Rugby</a>
</code]

I am trying to do it in C# and after writing in ASP classic for many years I am finding it a little tricky to get my head around!  My output above uses <br> but if there was an easy(ish) way of getting .NET to put it into a table that would be even better.

Would be very grateful for any pointers.

Thanks very much

Ed
 
Get the data from the DB and bind to a repeater. With a repeater, you can control the HTML that is output, so you can use tables, lists.. etc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top