Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Hiding an AccordianPane

  • 19-01-2011 03:46PM
    #1
    Registered Users, Registered Users 2 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, Registered Users 2 Posts: 12,025 ✭✭✭✭Giblet


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


  • Registered Users, Registered Users 2 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