Comunque:
codice:
ASPX
<form id="form1" runat="server">
<asp:PlaceHolder ID="PH" runat="server"></asp:PlaceHolder>
</form>
VB
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
For indice As Integer = 1 To 30
Dim lbutton As New LinkButton
lbutton.Text = "LinkButton N." & CStr(indice)
lbutton.ID = "L" & CStr(indice)
lbutton.CommandArgument = indice
AddHandler lbutton.Click, AddressOf GestoreLinkButtons
PH.Controls.Add(lbutton)
PH.Controls.Add(New LiteralControl("
"))
Next
End Sub
Private Sub GestoreLinkButtons(ByVal o As Object, ByVal e As System.EventArgs)
Dim argomento As Integer = CType(o, LinkButton).CommandArgument
.......
End Sub