.NET 2 Custom Control question

M

ME

I am trying to write my first site using .NET 2. I need a control that will
list several links to pages in a table (a simple nav control). The table
must have about 3 Columns and about 4 rows (or more depending on the amount
of links needed). The table will need to be built dynamically, but it
should display the links in only 1 row or only 1 column. In each cell a
hyperlink will be added (dynamically) that will link a a specific page. The
URL's for the hyperlinks will be read from a Database (used to be able to
use a DataReader, not sure if thats the best way now). In previous .NET 1.1
I could just open a datareader, cycle through and generate the table in the
pre-render event of the custom control. What would be the BEST way of
creating this type of control in .NET 2?

Thanks,

Matt


Table Example:

<table>

<tr>

<td>

<asp:HyperLink ID="HyperLink1" runat="server">HyperLink</asp:HyperLink></td>

<td>

<asp:HyperLink ID="HyperLink3" runat="server">HyperLink</asp:HyperLink></td>

<td>

<asp:HyperLink ID="HyperLink2" runat="server">HyperLink</asp:HyperLink></td>

</tr>

<tr>

<td >

<asp:HyperLink ID="HyperLink4" runat="server">HyperLink</asp:HyperLink></td>

<td>

<asp:HyperLink ID="HyperLink5" runat="server">HyperLink</asp:HyperLink></td>

<td>

<asp:HyperLink ID="HyperLink6" runat="server">HyperLink</asp:HyperLink></td>

</tr>

<tr>

<td>

<asp:HyperLink ID="HyperLink7" runat="server">HyperLink</asp:HyperLink></td>

<td>

<asp:HyperLink ID="HyperLink8" runat="server">HyperLink</asp:HyperLink></td>

<td>

<asp:HyperLink ID="HyperLink9" runat="server">HyperLink</asp:HyperLink></td>

</tr>

<tr>

<td>

<asp:HyperLink ID="HyperLink10"
runat="server">HyperLink</asp:HyperLink></td>

<td>

<asp:HyperLink ID="HyperLink11"
runat="server">HyperLink</asp:HyperLink></td>

<td>

<asp:HyperLink ID="HyperLink12"
runat="server">HyperLink</asp:HyperLink></td>

</tr>

</table>
 
S

Steve C. Orr [MVP, MCSD]

I can't think of any way that ASP.NET 2.0 makes this kind of custom
requirement much easier.
You could still use your old approach, or you could still use a Repeater, or
you could still use a Table control (that would probably be my preference).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top