本文介绍了控制回发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 限时删除!! 我遇到了问题。我有一个单选按钮,我可以动态生成一个文本框, i也有一个按钮id =btn和一个id为status的标签同一页 基本上我的目标是每当检查单选按钮时,动态生成一个文本框,并且必须在id =status的标签中检索在tex框中写入的任何文本。按钮单击=btn,但我面临的问题是,每当 i点击按钮,文本框只是消失,我无法检索文本,请有人帮助我??? protected void radiobutton_checked( object sender,EventArgs e) { if (radiobtn1.Checked == true ) { TextBox txtbox = new TextBox(); pnl.Controls.Add(txtbox); // (pnl是放置文本框的面板)// } protected void Upd_Click( object sender,EventArgs e) { if (txtbox.Text!= string .empty) { status.Text = 文本框中的文字是 + txtbox.Text; } 解决方案 尝试此链接,希望有人帮助你。点击 ASP.NET中动态创建的控件 [ ^ ] 如何在ASP.NET中动态创建控件并从中检索值 [ ^ ] i am getting a problem.i have a radio button on whose click i am generating a textbox dynamically,i also have a button id="btn" and a label with id "status" on the same page basically my objective is that whenever the radiobutton is checked,a textbox is generated dynamically,and whatsoever text is written in the tex box must be retrieved in the label with id="status" on the button click="btn",but the problem i am facing is that wheneveri click the button,the text box simply dissappears and i cant retrieve the text,please can someone help me???protected void radiobutton_checked(object sender, EventArgs e) { if (radiobtn1.Checked == true) { TextBox txtbox = new TextBox(); pnl.Controls.Add(txtbox); //(pnl is a panel in whch i m placing the textbox)//}protected void Upd_Click(object sender, EventArgs e) { if (txtbox.Text != string.empty) { status.Text ="text in textbox was"+txtbox.Text; } 解决方案 这篇关于控制回发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 1403页,肝出来的.. 09-06 18:59