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

Select Tab client side on PageLoad

4 Answers 384 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Markus
Top achievements
Rank 1
Markus asked on 23 Apr 2008, 01:48 PM
I want to select a particular tab (together with the multipage) on PageLoad on client side. Selecting the tab is no problem but I failed to get a reference to the radMultiPage to also select the correct PageView. On page load or TabOnLoad it seems that the control is not available the "$find" returns "null". When I select a tab by mouse the reference is available but there it is to late. Any ideas how to accomplish this task?

4 Answers, 1 is accepted

Sort by
0
Accepted
Paul
Telerik team
answered on 23 Apr 2008, 02:15 PM
Hello Markus,

Any JavaScript function named pageLoad() will automatically wireup as an Application.Load handler (basically, the client-side version of Page_Load).

Here's a sample code snippet that shows the needed approach.

<form id="form1" runat="server">  
    <asp:ScriptManager ID="ScriptManager1" runat="server">  
    </asp:ScriptManager> 
 
    <script type="text/javascript">  
    function pageLoad()  
    {  
        var myTabStrip = $find("<%= RadTabStrip1.ClientID %>")             
        var tab = myTabStrip.findTabByText("Root RadTab2");  
        tab.select();              
    }  
    </script> 
 
    <telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1">  
        <Tabs> 
            <telerik:RadTab runat="server" Text="Root RadTab1">  
            </telerik:RadTab> 
            <telerik:RadTab runat="server" Text="Root RadTab2">  
            </telerik:RadTab> 
        </Tabs> 
    </telerik:RadTabStrip> 
    <telerik:RadMultiPage ID="RadMultiPage1" runat="server">  
        <telerik:RadPageView ID="RadPageView1" runat="server">  
            RadPageView1</telerik:RadPageView> 
        <telerik:RadPageView ID="RadPageView2" runat="server">  
            RadPageView2</telerik:RadPageView> 
    </telerik:RadMultiPage> 
</form> 


Sincerely yours,
Paul
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Markus
Top achievements
Rank 1
answered on 24 Apr 2008, 08:50 AM
Hello Paul,

thanks for help in this way it is working!

The client "pageLoad" will be executed when page is ready loaded. Is there also an event availble when page starts with loading?

Regards Markus
0
Paul
Telerik team
answered on 24 Apr 2008, 10:40 AM
Hi Markus,

pageLoad is a shortcut for the Sys.Application.load event. For details on the matter please refer to the following ASP.NET article.

All the best,
Paul
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Markus
Top achievements
Rank 1
answered on 24 Apr 2008, 11:13 AM
Thanks for information!
Tags
TabStrip
Asked by
Markus
Top achievements
Rank 1
Answers by
Paul
Telerik team
Markus
Top achievements
Rank 1
Share this question
or