You need to add that control on page in panel or placeholer etc. You can set its visibility by setting Visible property of TextBox to true/false.
Here is an example for you.
1 TextBox tb = new TextBox();
2 tb.Text = "Dynamically Created";
3 PlaceHolder1.Controls.Add(tb);
PlaceHolder1 has been set on Page. By default visibility of TextBox control is true here.
Mark As Answer if this post is useful to you.
Thanks.