How add one more control in TextBox Programatically
I wanto become a software developer
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Praveen DhatrikaRank #3,145 · 455 reputationPosted Jan 4, 2016, 6:54 AM EST
Your subject says different from body
How to add one more control in TextBox programatically.
.aspx code
.aspx.cs code
protected void Page_Load(object sender, EventArgs e)
{
TextBox TB = new TextBox();
TB.ID = "TB1";
PlaceHolder1.Controls.Add(TB);
TB.Visible = true;
}
protected void Button1_Click(object sender, EventArgs e)
{
if (TB.visible==false)
{
TB.visible==true;
}
else
{
TB.visible==false;
}
}