lo que pasa es que quiero generar una lista desplegable pero no se cual es la propiedad DropDownList para que funcione bien y pueda verse bien en el FOR si alguien me puede ayudar cual es la propiedad que me falta en mi segundo for donde esta el DropDownList
<%@ Page Language="vb" %>
<script runat="server">
Sub Page_Load(sender As Object, e As EventArgs)
Dim numlabels as Integer
Dim numtexts as Integer
Dim i as Integer
' Show/Hide Panel Contents
If Check1.Checked Then
Panel1.Visible = False
Else
Panel1.Visible = True
End If
' Generate label controls
numlabels = CInt(DropDown1.SelectedItem.Value)
For i = 1 To numlabels
Dim l As Label = New Label()
l.Text = "Label" & i
l.ID = "Label" & i
Panel1.Controls.Add(l)
Panel1.Controls.Add(new LiteralControl("<br>"))
Next
' Generate textbox controls
numtexts = CInt(DropDown2.SelectedItem.Value)
For i = 1 To numtexts
Dim t As DropDownList = New DropDownList()
t.DropDownList ="dasd" &i
t.Id="DropDown1"&i
Panel1.Controls.Add(t)
Panel1.Controls.Add(new LiteralControl("<br>"))
Next
End Sub
</script>
<html>
<head>
</head>
<body>
<h3><font face="Verdana">Genracion de list box</font>
</h3>
<form runat="server">
<asp:Panel id="Panel1" runat="server" Width="300px" Height="200px" BackColor="gainsboro">Panel1: Here is some static content...
<p></p>
</asp:Panel>
<p>
Generate Labels:
<asp:DropDownList id="DropDown1" runat="server">
<asp:ListItem Value="0">0</asp:ListItem>
<asp:ListItem Value="1">1</asp:ListItem>
<asp:ListItem Value="2">2</asp:ListItem>
<asp:ListItem Value="3">3</asp:ListItem>
<asp:ListItem Value="4">4</asp:ListItem>
</asp:DropDownList>
<br />
Generate TextBoxes:
<asp:DropDownList id="DropDown2" runat="server">
<asp:ListItem Value="0">0</asp:ListItem>
<asp:ListItem Value="1">1</asp:ListItem>
<asp:ListItem Value="2">2</asp:ListItem>
<asp:ListItem Value="3">3</asp:ListItem>
<asp:ListItem Value="4">4</asp:ListItem>
</asp:DropDownList>
</p>
<p>
<asp:CheckBox id="Check1" runat="server" Text="Hide Panel"></asp:CheckBox>
</p>
<p>
<asp:Button id="Button1" runat="server" Text="Refresh Panel"></asp:Button>
</p>
</form>
</body>
</html>