Results 1 to 8 of 8

Thread: [2008] AJAX CollapsiblePanelExtender

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    262

    [2008] AJAX CollapsiblePanelExtender

    I am attempting to use the CollapsiblePanelExtender but for some reason it never expands or collapses.. Do I need some codebehind for this tool to work?

    Code:
    <%@ Page Language="C#" MasterPageFile="MasterPage.Master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default2" Title="Untitled Page" %>
    
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="atk" %>
    
    
    
    
    
    <asp:Content ID="cbody" runat="server" ContentPlaceHolderID="body">
    
            <style type="text/css">
            .cpBody
            {
                background-color: #DCE4F9;
                font: normal 11px auto Verdana, Arial;
                border: 1px gray;                
                width:450px;
                height: 0px;
                padding: 4px;
                padding-top: 7px;
                overflow:hidden;
            }       
        </style>
                <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:UpdatePanel ID="upLR" runat="server" >
            <ContentTemplate>
            <atk:CollapsiblePanelExtender
        ID="cpe"
        Runat="server"     
        TargetControlID="pBody"
        CollapsedSize="0"
        ExpandedSize="300"
        Collapsed="True"
        ExpandControlID="pHeader"
        CollapseControlID="pHeader"
        AutoCollapse="False"
        AutoExpand="False"
        ScrollContents="True"
        TextLabelID="lblText"
        CollapsedText="Show Details..."
        ExpandedText="Hide Details" 
        ExpandDirection="Vertical" />
                        <asp:Panel ID="pHeader" runat="server">
                    <asp:Label ID="lblText" runat="server" Text="License Request" />
                </asp:Panel>
     
                <asp:Panel ID="pBody" runat="server" CssClass="cpBody">
                        <ul>
                            <li><a href="">Production</a></li>
                            <li><a href="">Pre-Production</a></li>
                            <li><a href="">Development</a></li>
                        </ul>
                </asp:Panel>
     
    
    
            </ContentTemplate>
        </asp:UpdatePanel>
    
    </asp:Content>

  2. #2
    Addicted Member
    Join Date
    Dec 2006
    Location
    Between Try & Catch
    Posts
    249

    Re: [2008] AJAX CollapsiblePanelExtender

    Does it throw any javascript errors when you click on it?

    I also thought the script manager tag was supposed to be at the top of the page?

    Oh, you're using a Masterpage. I'm afraid I'll be of little help in that area.
    If my post helped you, please rate it!

    Languages: VB/ASP.NET 2005, C# 2008,VB6
    Databases: Oracle (knowledge not currently in use), DB2

    FROM Customers
    WHERE We_Know_What_We_Want <> DB.Null
    SELECT *
    0 rows returned

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [2008] AJAX CollapsiblePanelExtender

    Do you have the ToolKitScriptManager on the masterpage ?

  4. #4
    Banned timeshifter's Avatar
    Join Date
    Mar 2004
    Location
    at my desk
    Posts
    2,465

    Re: [2008] AJAX CollapsiblePanelExtender

    I hate that control. The jQuery slideToggle method is muuuuuuch smoother, easier to implement, and generates a lot less code, not to mention has a faster load time as there's no server control to be rendered. However, things I notice about your control definition:

    AutoCollapse and AutoExpand are two properties I've never used... you don't need them.
    ExpandedSize and CollapsedSize - also not needed. Use CSS to make the panel look like what you want, then set Collapsed=True. It knows that with nothing specified, Collapsed = not visible.

    See if pulling those properties fixes anything.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    262

    Re: [2008] AJAX CollapsiblePanelExtender

    I've tried putting the ToolKitScriptManager on both the default.aspx page and the masterpage, neither has worked. I don't even see the Expanded or Collapsed text appearing..

  6. #6
    Banned timeshifter's Avatar
    Join Date
    Mar 2004
    Location
    at my desk
    Posts
    2,465

    Re: [2008] AJAX CollapsiblePanelExtender

    Did you try removing those extra properties that you don't need?

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    262

    Re: [2008] AJAX CollapsiblePanelExtender

    Yes I have removed the fields you suggested to remove... also note the collapsed property is set to true and the CSS is defined at the stop of the page

    no text ever shows up on lblText and the panel pBody is always expanded

  8. #8
    Banned timeshifter's Avatar
    Join Date
    Mar 2004
    Location
    at my desk
    Posts
    2,465

    Re: [2008] AJAX CollapsiblePanelExtender

    OK, this is going to sound crazy... try changing the TagPrefix of the Toolkit to "ajaxToolkit". I just recalled having a similar issue with the Toolkit where something that appeared syntactically correct just wasn't working, and using the default tag prefix fixed it for me... don't ask me why. Maybe you're just having the same issue.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width