Rick,
I’m not too sure what you’re trying to do, but it is possible to add a link button in the Page_Load and have it fire off a command.
In my VB file I have this code:
Dim lb As LinkButton
Private Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
lb = New LinkButton
lb.ID = "LinkButton1"
lb.Text = "LinkButton"
AddHandler lb.Command, AddressOf cmdLink
putlb.Rows(0).Cells(0).Controls.Add(lb) 'Puts lb on page...
End Sub
Public Sub cmdLink(ByVal sender As Object, ByVal e As CommandEventArgs)
'Do something
End Sub
In my ASCX file I have this code:
<table id="putlb" runat="server">
<tr>
<td>
</td>
</tr>
</table>
If you can help it, stay away from doing this… It’s possible but it’s usually not worth the headaches. If you do have to go this route get real familiar with the page load life cycle.
-- Nathan Rover