Bug in Multiview?!

Discussion in 'ASP .Net' started by Giorgio, May 21, 2007.

  1. Giorgio

    Giorgio Guest

    Hi all,

    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, May 21, 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. Replies:
    0
    Views:
    532
  2. Stephen

    multiview without postback

    Stephen, Aug 2, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    7,096
    Stephen
    Aug 2, 2005
  3. Replies:
    7
    Views:
    5,989
  4. =?Utf-8?B?RmFidWxvdXNzaXRlcw==?=

    Databinding Problem with Dropdownlist with Multiview Control in VB

    =?Utf-8?B?RmFidWxvdXNzaXRlcw==?=, Jan 9, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    2,077
    =?Utf-8?B?RmFidWxvdXNzaXRlcw==?=
    Jan 9, 2006
  5. Andy B
    Replies:
    0
    Views:
    397
    Andy B
    Dec 29, 2008
Loading...

Share This Page