<SCRIPT language="vb" runat="server">
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
btnAdd.Attributes("onClick") = "return(confirm('Confermi?'))"
End Sub
Sub addControls(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim lbNome as New Label()
lbNome.Text = "Ciao "
Dim tbNome as New TextBox()
tbNome.Text = "Scrivi il tuo nome"
phControls.Controls.Add(lbNome)
phControls.Controls.Add(tbNome)
End Sub
</SCRIPT>
<form runat="server" ID="Form1">
<asp:Button id="btnAdd" runat="server" Text="Inserisci i controlli a runtime..." onclick="addControls"></asp:Button><BR>
<BR>
<ASP:PlaceHolder id="phControls" runat="server" />
</form>