Link to home
Start Free TrialLog in
Avatar of Carl3003
Carl3003

asked on

How do you copy objects from one placeholder into another..

In my sample i wanted to create another placeholder with the same objects in it and place it in a different part of the page but for some reasons i could not just say phMyLinks=phMyLinks2 . I also tried to populate both placeholders at run time but it was populating only one of them. One way was  to explicitely create another LinkButton and to make all actions parallel to both placeholders. I am looking to find an easier solution whereas i could populate both placeholders altogether  .
Thanks

Label lblPage=new Label();
lblPage.Text="Page : ";
this.phMyLinks.Controls.Add(lblPage);      
for(int i=1;i<=pageTotal;i++)
{
      myLink=new LinkButton();
      myLink.Text=" " + Convert.ToString(i) + " ";
      myLink.Click+=new EventHandler(myLink_Click);
      phMyLinks.Controls.Add(myLink);  //this becomes empty
                phMyLinks1.Controls.Add(myLink);  
}

       
SOLUTION
Avatar of Thogek
Thogek
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial