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 whenever
i 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);
}
protected void Upd_Click(object sender, EventArgs e)
{
if (txtbox.Text != string.empty)
{
status.Text ="text in textbox was"+txtbox.Text;
}