我的页面上有一个面板:
<asp:Panel ID="pnlTest" runat="server" />
然后我在 Page_Load 上动态添加一个 TextBox:
TextBox simpleTextBox = new TextBox();
pnlTest.Controls.Add(simpleTextBox);
simpleTextBox.ID = "SimpleTextBox-1";
有没有办法在不直接从 Request.Form 中提取的情况下提取在此 TextBox 中键入的信息?我想在我再次添加后我可以做这样的事情:
lblPresentResults.Text = myTextBox.Text;
我知道这个例子似乎是做作的,但我想我会尝试消除我的特定应用程序中的所有其他变量,尤其是在这里提出问题。