Setting Nested User Controls Visible Property

  • Thread starter Donald Williamson
  • Start date
D

Donald Williamson

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top