Click here to Skip to main content
15,891,473 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi all...

pls help me to add multiple controls dynamically in asp.net.
Posted

Start here[^]. Found this on Google in less than 30 seconds: how come you couldn't?
 
Share this answer
 
Comments
Pankil_Plus 1-May-14 14:51pm    
best one with ready made code
hello

this may help you...


C#
public void AddDynamicControls()
       {
           int j=5;
       for(int i=1; i<=j; i++)
           {
               CheckBox objcheckbox = new CheckBox();
               objcheckbox.Name = i.ToString();
               objcheckbox.Text = i.ToString() + "checkbox";

           panel1.Controls.Add(objcheckbox);
             //  groupBox1.Controls.Add(objcheckbox);
           }
       }


thank you
happy to help
 
Share this answer
 
hello

this may help you...


C#
public void AddDynamicControls()
       {
           int j=5;
       for(int i=1; i<=j; i++)
           {
               CheckBox objcheckbox = new CheckBox();
               objcheckbox.Name = i.ToString();
               objcheckbox.Text = i.ToString() + "checkbox";

           panel1.Controls.Add(objcheckbox);
             //  groupBox1.Controls.Add(objcheckbox);
           }
       }


thank you
happy to help
 
Share this answer
 
hello

this may help you...


C#
public void AddDynamicControls()
       {
           int j=5;
       for(int i=1; i<=j; i++)
           {
               CheckBox objcheckbox = new CheckBox();
               objcheckbox.Name = i.ToString();
               objcheckbox.Text = i.ToString() + "checkbox";

           panel1.Controls.Add(objcheckbox);
             //  groupBox1.Controls.Add(objcheckbox);
           }
       }


thank you
happy to help
 
Share this answer
 
hello

this may help you...


C#
public void AddDynamicControls()
       {
           int j=5;
       for(int i=1; i<=j; i++)
           {
               CheckBox objcheckbox = new CheckBox();
               objcheckbox.Name = i.ToString();
               objcheckbox.Text = i.ToString() + "checkbox";

           panel1.Controls.Add(objcheckbox);
             //  groupBox1.Controls.Add(objcheckbox);
           }
       }


thank you
happy to help
 
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