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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Hiding an AccordianPane

  • 19-01-2011 2: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: 11,989 ✭✭✭✭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