I have a repeater:
or a gridview
There is a database table that has two fields:
name page
Page 1 default.aspx
Page 2 whatever.aspx
Page 3 test.aspx
When I click on Page 1 on the grid, it should take me to default.aspx
How do i add hyperlink or linkbutton to either gridview or repeater (whichever one is better) at run time?
I don't want to touch the design
For now I can only bind the data to the repeater/gridview
Code:
<asp:Repeater ID="repeater1" runat="server">
</asp:Repeater>
Code:
<asp:GridView ID="GridView1" runat="server">
</asp:GridView>
There is a database table that has two fields:
name page
Page 1 default.aspx
Page 2 whatever.aspx
Page 3 test.aspx
When I click on Page 1 on the grid, it should take me to default.aspx
How do i add hyperlink or linkbutton to either gridview or repeater (whichever one is better) at run time?
I don't want to touch the design
For now I can only bind the data to the repeater/gridview
Code:
dim reader As SqlDataReader
dim objCommand As SqlCommand
dim sql as string = "SELECT name, page from webpages"
objCommand = New SqlCommand(sql, sqlConnection1)
reader = objCommand.ExecuteReader()
repeater1.DataSource = reader [COLOR="blue"] ' OR GridView1.DataSource = reader[/COLOR]