Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Hiding an AccordianPane

Options
  • 19-01-2011 3:46pm
    #1
    Registered Users Posts: 3,992 ✭✭✭


    Right so im using an Ajax Accordian to show users different control panels and information.

    My question is how do I hide one of the panes from certain users...

    Code:
    <cc1:Accordion  ID="leftNavAccordion" 
                                                runat="server" 
                                                HeaderCssClass="accordianHeader"
                                                ContentCssClass="accordianContent" 
                                                CssClass="NavAccordian" 
                                                FadeTransitions="true"
                                                Width="210px">
                                    <Panes>
                                        
                                        <cc1:AccordionPane ID="CorrectionsPane" runat="server">
                                            <Header>
                                                <% Response.Write(XBrowser.ValidateImage("<img alt=\"\" src=\"../Images/Panels/corrections.png\" />", 24, 24));%>
                                                <asp:Literal ID="litCorrections" runat="server" Text="<%$ Resources:LocalizedText, CC_Corrections%>" />
                                            </Header>
                                            <Content>
                                                <asp:PlaceHolder ID="topLeftModule" runat="server" />
                                                <uc2:MiniCorrectionsModule ID="MiniCorrectionsModule1" runat="server" />
                                            </Content>
                                        </cc1:AccordionPane>
                                        
                                        <cc1:AccordionPane ID="MessagingPane" runat="server">
                                            <Header>
                                                <% Response.Write(XBrowser.ValidateImage("<img alt=\"\" src=\"../Images/Panels/mail.png\" />", 24, 24));%>
                                                <asp:Literal ID="litMessaging" runat="server" Text="<%$ Resources:LocalizedText, CO_Messaging%>" />
                                            </Header>
                                            <Content>
                                                <ucMail:MiniMailModule ID="MiniMailModule1" runat="server" />
                                            </Content>
                                        </cc1:AccordionPane>
                                        
                                        
                                    </Panes>
                                </cc1:Accordion>
    

    Right so I want to hide the "MessagingPane" pane.

    My first thoughts were to add in a visible attribute and have the attribute populated by a variable thats set in the .cs file.
    <cc1:AccordionPane ID="MessagingPane" runat="server" visible="<%= messageVisibleBool%>">
    

    this doesn't work and gives the error:

    Cannot create an object of type 'System.Boolean' from its string representation '<%= messageBool%>' for the 'Visible' property.

    Ive tried many other variations also and none work,
    <cc1:AccordionPane ID="MessagingPane" runat="server" visible="<%[B]#[/B] [B]messageVisibleBool[/B]%>">
    
    <cc1:AccordionPane ID="MessagingPane" runat="server" visible="<%[B]=[/B] [B]messageVisibleString[/B]%>">
    
    <cc1:AccordionPane ID="MessagingPane" runat="server" visible="<%[B]#[/B] [B]messageVisibleString[/B]%>">
    
    

    anyone have any ideas? Or perhaps an alternate way of doing this?

    Thanks!


Comments

  • Registered Users Posts: 11,980 ✭✭✭✭Giblet


    Any reason you can't do
    MessagingPane.Visible = boolVariable;
    
    in the cs class?


  • Registered Users Posts: 3,992 ✭✭✭Korvanica


    Giblet wrote: »
    Any reason you can't do
    MessagingPane.Visible = boolVariable;
    
    in the cs class?

    :cool: Excellent... Thanks for that...


Advertisement