Hi Venkat,
Put IsPostBack condition to avoid postback on button click. If you click the button again the form
get loaded and values will be cleared. So you will not get the values of textbox. Kindly give me the
valuable feedback about my code.
Try the below the code:
public partial class Default6 : System.Web.UI.Page
{
TextBox txt123;
protected void Page_Load(object sender, EventArgs e)
{
if( !isPostBack)
{
txt123 = new TextBox();
Panel1.Controls.Add(txt123);
}
}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Write(txt123.Text);
}
}
With regards,
J.Prabu.
[Email:prbspark@gmail.com]
Nksingh420, if this helps please login to Mark As Answer. | Alert Moderator