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