Its easy to write a linkbutton into an aspx page like so:
<asp:LinkButton ID="lbDate" runat="server" Text="Click Me" OnClick="lbDate_click" CommandArgument="1" />
But how do I dynamically create one? The Onclick method is protected and cannot be set programmatically. Here's what I'm trying to do...
For i = 0 To 9
Dim lbDate As LinkButton = New LinkButton
lbDate.ID = "lb" & i
lbDate.Text = "Test " & i
lbDate.Onclick = "lbDate_click" 'Doesn't work, onclick is protected. HELP!
lbDate.CommandArgument = i