Wednesday, 14 August 2013

creat textbox dynamically and get it's value

creat textbox dynamically and get it's value

TextBox t1 = new TextBox();t1.Text="123";
qwe2.controls.AddControl(t1);
I added textbox dynamically to qwe2 qwe2 is just a panel
<asp:panel ID="qwe2" runat="server"></asp:panel>
and then on button_submit a have a function
public void button_click(object sender, EventArgs e)
{ var x = t1.Text}
but t1.text is empy why so? and how to get the value;

No comments:

Post a Comment