aspnoobie
03-19-04, 07:51 AM
hi experts
i am thinking of how can i hyperlink a tablecell using asp.net controls.
i know how to add a hyperlink to a tablecell by
<script language="vb" runat="server">
sub page_load()
dim r as new tablerow
dim c as new tablecell
r.Cells.add(c)
table1.rows.add(r)
Dim h As New HyperLink()
h.Text = "abc"
h.NavigateUrl = "somewebsite.htm"
c.Controls.Add(h)
end sub
</script>
<html>
<body>
<asp:table id="Table1" runat="server" border="1"/>
</body>
</html>
but the text "abc" is actually hyperlink, not the tablecell.i want to know how because i want to retrieve data from the database and create a dynamic table with all the cell hyperlinked to some pages. i work with traditional asp page before and do it using lots of "spagetti" codes. can anyone enlighten me how to use asp.net to do that. thanks in advance!
i am thinking of how can i hyperlink a tablecell using asp.net controls.
i know how to add a hyperlink to a tablecell by
<script language="vb" runat="server">
sub page_load()
dim r as new tablerow
dim c as new tablecell
r.Cells.add(c)
table1.rows.add(r)
Dim h As New HyperLink()
h.Text = "abc"
h.NavigateUrl = "somewebsite.htm"
c.Controls.Add(h)
end sub
</script>
<html>
<body>
<asp:table id="Table1" runat="server" border="1"/>
</body>
</html>
but the text "abc" is actually hyperlink, not the tablecell.i want to know how because i want to retrieve data from the database and create a dynamic table with all the cell hyperlinked to some pages. i work with traditional asp page before and do it using lots of "spagetti" codes. can anyone enlighten me how to use asp.net to do that. thanks in advance!