Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 23, 2012 02:13 PM by ramiramilu
Apr 23, 2012 01:21 PM|LINK
Here's something that someone could answer in their sleep. How do I from the code behind place multiple Hyperlink Buttons on a page with the same ID except the number is increasing by 1 each time. So for example:
<asp:hyperlink ID="File1" runat="server"/>
<asp:hyperlink ID="File2" runat="server"/>
<asp:hyperlink ID="File3" runat="server"/>
Or how do I create Hyperlink buttons in the code behind with a ID and the render them to a panel?
Thanks guys for any Input that you can have on this.
Apr 23, 2012 01:27 PM|LINK
Use the following:
for (int i=1;i<=5;i++)
HyperLink h = new HyperLink();
//Set some other properties
h.ID = "File"+i.ToString();
See the following for more info:
Apr 23, 2012 02:13 PM|LINK
Put up a Repeater control with Hyperlink in it and then databind to List<string> then you will have this kind of behaviour..