Click here to Skip to main content
15,888,968 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am using 2 panels and 2 CollapsiblePanelExtenders. I would like to make these collapsible one at a time.
I am using visual studio 2005.
My javascript code gives error and doesn't work
Code is
JavaScript
        function pageLoad(sender, args) {           
            for (num = 1; num < 3; num++) {
                $find("CollapsiblePanelExtender" + num).add_expandComplete(coll_ExpandedComplete);               
            }
        }
 
        function coll_ExpandedComplete(sender, arg) {           
            for (num = 1; num < 3; num++) {
var CollapsiblePanel = $find("CollapsiblePanelExtender" + num);
if (sender._expandControlID != CollapsiblePanel._expandControlID)
                    CollapsiblePanel.collapsePanel(CollapsiblePanel._expandControlID);
            }          
        }               
Please give me the solution.
Posted
Updated 20-Feb-12 20:52pm
v2
Comments
André Kraak 21-Feb-12 2:53am    
Edited question:
Corrected pre tags
Spelling/Grammar
Mousumi2708 21-Feb-12 2:59am    
thanks bro..
but it still gives error on that line
" $find("CollapsiblePanelExtender" + num).add_expandComplete(coll_ExpandedComplete); "
BobJanova 21-Feb-12 6:46am    
Did you give the collapsible panel extenders different IDs?
Mousumi2708 23-Feb-12 8:02am    
yes ,I gave two different IDs

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900