Setting Nested User Controls Visible Property

Discussion in 'ASP .Net Web Controls' started by Donald Williamson, Nov 7, 2003.

  1. Hope someone can help me with this one.



    I have two user controls - 'Footer' and 'SideBar'. The Footer control
    contains the SideBar control.



    From the main page, I'm wanting to pass in a visible property to Footer
    which would tell it to whether to display the SideBar control



    Here's the main page that calls the Footer control:

    <USER:SITEFOOTER id="Footer" DisplaySideBar=True
    runat="server"></USER:SITEFOOTER>



    The Footer page contains the following property:



    Property DisplaySideBar () As Boolean

    Get

    Return dispayBar

    End Get

    Set(ByVal Value As Boolean)

    displayBar = Value

    End Set

    End Property



    The Footer page then calls the SideBar

    <USER:SideBar id="Bar" runat="server" DisplaySideBar= <%#DisplaySideBar%> >



    The problem is that DisplaySideBar does not appear to be getting set or even
    working. If I hardcode the following, it works fine:

    <USER:SideBar id="Bar" runat="server" DisplaySideBar= true >

    or

    <USER:SideBar id="Bar" runat="server" DisplaySideBar= false >



    So the question is what's the right way to do this? Please let mw know if
    you need any more info. Thanks.



    - Donald
     
    Donald Williamson, Nov 7, 2003
    #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. spamfurnace
    Replies:
    1
    Views:
    2,640
    Scott M.
    May 24, 2004
  2. Andrew Backer
    Replies:
    2
    Views:
    715
    Andrew Backer
    Jun 17, 2005
  3. Samuel Shulman
    Replies:
    1
    Views:
    485
    Poornimab
    Jun 20, 2006
  4. Andrea Williams

    User control not visible when setting .Visible = true;

    Andrea Williams, Jan 26, 2004, in forum: ASP .Net Web Controls
    Replies:
    4
    Views:
    526
    Andrea Williams
    Jan 28, 2004
  5. Jurjen de Groot
    Replies:
    0
    Views:
    314
    Jurjen de Groot
    May 19, 2008
Loading...

Share This Page