Results 1 to 3 of 3

Thread: twice same usercontrol on 1 page

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2002
    Location
    Belgium
    Posts
    99

    twice same usercontrol on 1 page

    Hello everybody,


    I'm trying to load twice the same usercontrol on my webpage with this code :
    VB Code:
    1. Dim myCtl1 As Colli = Page.LoadControl("colli.ascx")
    2.         Dim myCtl2 As Colli = Page.LoadControl("colli.ascx")
    3.  
    4.         'Controls.Add(myCtl1)
    5.         PlaceHolder1.Controls.Add(myCtl1)
    6.  
    7.         PlaceHolder2.Controls.Add(myCtl2)

    It only appears once My placeholder 2 is much lower on my page, so they aren't on top of each other.

    Anyone has ideas if this is possible ?


    Thanks,

    Bjorn

  2. #2
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Works for me:
    Make sure visible is set to true for the placeholder.

    Code:
    private void Page_Load(object sender, System.EventArgs e)
    {
        PlaceHolder1.Controls.Add(LoadControl("CurrentTimeStamp.ascx"));
        PlaceHolder2.Controls.Add(LoadControl("CurrentTimeStamp.ascx"));
    }

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2002
    Location
    Belgium
    Posts
    99
    Hi Lethal,


    I already know the reason ... It was because of the dhtml.

    My two panels where exactly placed on top of each other. I saw it in my source code !

    Thanks !

    Bjorn

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width