Dynamic Textbox should be define as global and you have to add that control into your form like
public partial class _Default : System.Web.UI.Page
{
TextBox dynamicTBox = new TextBox();
protected void Page_Load(object sender, EventArgs e)
{
this.Form.Controls.Add(dynamicTBox);
}
protected void btnSave_Click(object sender, EventArgs e)
{
Response.Write(dynamicTBox.Text);
}
}
After entering the value into textbox and before clicking on the "save" button, If you do any server event then you will lost your textbox value and in that case you need to store that textbox value into viewstate or into session.
If this helped you then please Vote and Accept as Answer. :rose: