This is a migrated thread and some comments may be shown as answers.

Conditional disable Ajax

3 Answers 73 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
roger
Top achievements
Rank 1
roger asked on 18 Sep 2008, 08:41 PM
Hi,

I have a RadTabStrip in RadAjaxPanel. I write server-side code to handle the TabClick event. Most of tabs act Ajax-enable. Only one tab I want it can do a full post back. How to conditional disable the Ajax for this specific Tab?

Thanks

 

3 Answers, 1 is accepted

Sort by
0
Paul
Telerik team
answered on 19 Sep 2008, 06:20 AM
Hello roger,

Please find below a sample code snippet that shows the needed approach.

<form id="form1" runat="server">  
    <asp:ScriptManager ID="ScriptManager1" runat="server">  
    </asp:ScriptManager> 
    <telerik:RadCodeBlock runat="server">  
 
        <script type="text/javascript">  
        function disableAJAX(sender, eventArgs)  
        {  
            var tab = eventArgs.get_tab();  
            var updatePanel = $find('<%= RadAjaxPanel1.ClientID %>')  
            if(tab.get_text() == "Root RadTab2")  
            {  
                updatePanel.set_enableAJAX(false);  
            }  
        }  
        </script> 
 
    </telerik:RadCodeBlock> 
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">  
        <telerik:RadTabStrip ID="RadTabStrip1" runat="server" OnClientTabSelecting="disableAJAX" OnTabClick="RadTabStrip1_TabClick">  
            <Tabs> 
                <telerik:RadTab runat="server" Text="Root RadTab1">  
                </telerik:RadTab> 
                <telerik:RadTab runat="server" Text="Root RadTab2">  
                </telerik:RadTab> 
                <telerik:RadTab runat="server" Text="Root RadTab3">  
                </telerik:RadTab> 
            </Tabs> 
        </telerik:RadTabStrip> 
    </telerik:RadAjaxPanel> 
</form> 


Sincerely yours,
Paul
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
roger
Top achievements
Rank 1
answered on 19 Sep 2008, 03:26 PM

Hi Paul,

Your code works very well.
But,  my application is using one RadAjaxManager on MasterPage. I add the AjaxSettings  on content page's load event accordingly. So my further question is how to get the reference of the RadAjaxManager  from content page in your script.

var
ajaxManager = $find('<%= RadAjaxManager1.ClientID %>')  is not working in this senario.


Thanks

0
Atanas Korchev
Telerik team
answered on 19 Sep 2008, 03:33 PM
Hello roger,

You can check this online example. Please check the description which explains how to get the ajax manager object from the master page.

Regards,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
TabStrip
Asked by
roger
Top achievements
Rank 1
Answers by
Paul
Telerik team
roger
Top achievements
Rank 1
Atanas Korchev
Telerik team
Share this question
or