62,046
社区成员
发帖
与我相关
我的任务
分享
<body>
<form id="form1" runat="server">
<div>
<asp:Table ID="Table1" runat="server" ></asp:Table>
</div>
<asp:Button ID="bt" runat="server" Text="sumbit" onclick="bt_Click" />
</form>
</body>
public partial class sounds_Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
TableRow row = new TableRow();
TableCell cell = new TableCell();
TextBox tebox = new TextBox();
tebox.ID = "txtid001";
tebox.Text = "已找到值";
cell.Controls.Add(tebox);
row.Cells.Add(cell);
this.Table1.Rows.Add(row);
}
protected void bt_Click(object sender, EventArgs e)
{
TextBox te = (TextBox)this.FindControl("txtid001");
Response.Write(te.Text);
}
}