Click here to Skip to main content
15,881,687 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
in a webpart after the button is clicked the textbox and label should be displayed
Posted

1 solution

C#
protected void Button1_Click(Object sender,Eventargs e)
{
     label1.visible = true; // set property as visible false prior
     textbox1.visible = true; //set property as visible false prior
}



or you can do it dynamically
C#
protected void Button1_Click(Object sender,Eventargs e)
{
    Label lable1 = new Label();
    TextBox textbox1 = new TextBox();
    
    //you will need to have a container( placeholder or panel) control where you want to add them
   contarinerControl.Add(label1);
   contarinerControl.Add(textbox1);

 
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900