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
670
Cancel a postback?
posted

Is there a way to selectively cancel a postback depending on the tab using client script? I have tried trapping the before tab changed event and using return true or return false and also oEvent.needPostBack=false; and nothing seems to work.

I need to post back only two of the 10 tabs to ensure a webgrid is properly populated (another odd thing).

Parents
No Data
Reply
  • 65
    posted

     Hope my codes is useful to you. It works wellonmy machine.

            function UltraWebTab_Main_BeforeSelectedTabChange(oWebTab, oTab, oEvent)
            {
                switch (oTab.getText())
                {
                    case "Contact Information":
                        oEvent.needPostBack = true;
                        break;
                    case "Feedbacks":
                        oEvent.needPostBack = true;
                        break;
                    default:
                        oEvent.needPostBack = false;
                        break;
                                      
                }
            }

     

                        <igtab:ultrawebtab id="UltraWebTab_Main"  runat="server" dummytargeturl=" "
                            height="100%" width="100%">
                            <ClientSideEvents BeforeSelectedTabChange="UltraWebTab_Main_BeforeSelectedTabChange" />
                             .......

                        </igtab:ultrawebtab>

     

            protected void UltraWebTab_Main_TabClick(object sender, Infragistics.WebUI.UltraWebTab.WebTabEvent e)
            {
                switch (e.Tab.Text)
                {
                    case "Contact Information":
                        Populate_ContactInformationTab();
                        break;
                    case "Participants":
                        break;

                    case "Feedbacks":
                        Populate_Feedbacks();
                        break;
                }
            }

Children
No Data