web user control with a multiview urgent help

Discussion in 'ASP .Net Web Controls' started by Giorgio, Oct 10, 2007.

  1. Giorgio

    Giorgio Guest

    Hi

    Maybe I am being stupid or this is a bug and I need some urgent help please.

    I have a web user control with a multiview that has 2 views. I have 3 public
    properties setup and one of the properties will be used to identify which
    view to be set as an active view.

    Then on the page I have the following Function that will return a web user
    control and the id3 will be used to set the active view.

    Private Function GetControl(ByVal id1 As Integer, ByVal id2 As Integer,
    ByVal id3 As Integer) As UserControl
    Dim ctrl As ASP.components_ctrl_ascx = LoadControl("~/components/ctrl.ascx")
    ctrl.id1 = id1
    ctrl.id2 = id2
    ctrl.id3 = id3
    Return ctrl
    End Function

    Then on the page I have the following code to load the controls to a
    placeholder.

    Me.plh1.Controls.Add(GetControl(id1, id2, id3))
    Me.plh1.Controls.Add(GetControl(id4, id5, id6))

    The id3 and id6 will be set as a different active view but the problem is
    that I only get 1 control added to the page and that's the first one and I
    don't understand why!!

    If I remove the multiview control and the property that sets the active view
    then the 2 controls are added to the placeholder without any problem!!

    If this is not a bug and I am being stupid then can someone please tell me
    what I am doing wrong and show me some code in how to fix this?!!

    Thanks a lot
     
    Giorgio, Oct 10, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brad Isaacs

    Menu Control with Multiview Control ???

    Brad Isaacs, Feb 8, 2007, in forum: ASP .Net
    Replies:
    5
    Views:
    822
    Brad Isaacs
    Feb 9, 2007
  2. Yin99
    Replies:
    1
    Views:
    468
    =?Utf-8?B?TmF0aGFuaWVsIEdyZWVuZQ==?=
    Aug 20, 2007
  3. iHavAQuestion
    Replies:
    0
    Views:
    579
    iHavAQuestion
    Apr 28, 2008
  4. Andy B
    Replies:
    0
    Views:
    374
    Andy B
    Dec 29, 2008
  5. Lamy

    Tab control with Multiview control

    Lamy, Apr 23, 2007, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    95
Loading...

Share This Page