RE:Como crear controles dinamicamente?
Mira en el código HTML en el TD donde quieres que aparescan pones una variable VB
<td>
<% =strTabla%>
</td>
la variable strTabla la declaras Public para que la tome el HTML
Después haces el procedimiento para que cree los TextBox:
Private Sub CrearTabla(ByVal IntNoText As Integer)
strTabla = "<table style=" & Chr(34) & "width:200px;" & Chr(34) & ">"
For A As Integer = 1 To IntNoText
strTabla += "<tr><td><input Id=" & Chr(34) & "myText" & A & Chr(34) & " runat=" & Chr(34) & "server" & Chr(34) & " /></td></tr>"
Next
strTabla += "</table>"
End Sub
te paso el código HTML y VB.Net
VB.Net:
Partial Class FormasAdministracion_Default
Inherits System.Web.UI.Page
Public strTabla As String
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
CrearTabla(Me.TextBox1.Text)
End Sub
Private Sub CrearTabla(ByVal IntNoText As Integer)
strTabla = "<table style=" & Chr(34) & "width:200px;" & Chr(34) & ">"
For A As Integer = 1 To IntNoText
strTabla += "<tr><td><input Id=" & Chr(34) & "myText" & A & Chr(34) & " runat=" & Chr(34) & "server" & Chr(34) & " /></td></tr>"
Next
strTabla += "</table>"
End Sub
End Class
HTML:
%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="FormasAdministracion_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table style="width:300px">
<tr>
<td>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Button ID="Button1" runat="server" Text="Button" /></td>
</tr>
<tr>
<td>
<%=strTabla %>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
Saludos.