Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
280
problem posting back the expand event of WebPanel
posted

Hi,

 I have 3 WebPanels within a WebRefreshPanel. At any time only one panel should be expanded and the rest collapsed. The data within the panel should be reloaded when expanded and avoid a postback on collapse. So I have added the ExpandedStateChanging client side event and OnExpandedStateChanging event on server side for each panel and checking the state of panel in the javascript using the below script and posting back the event to server so that I do post back only on expand event.

function wpMyPanel_ExpandedStateChanging(oWebPanel, oEvent){

        if(igpnl_getPanelById('<%= wpMyPanel.ClientID %>').getExpanded()){

        //oEvent.needPostBack = false;

        oEvent.cancelPostBack = true;        return false;

        }

    return true;

}

Now the idea works perfectly as required but the only problem is that

if I repeatedly collapse the and expand the same panel, I only get a postback for the first time and not for the subsequent events where the WebRefreshPanel is pretending as if it is doing an asynchronous postback showing the progress indicator.

But if I expand other panels and then try to expand the first panel I get a postback properly. I tried to debug with no success. I dont understand why I dont get a postback event to server.

Can any one help me?