?
Solved

RadTabStrip - selected tab

Posted on 2011-04-30
2
Medium Priority
?
6,927 Views
Last Modified: 2012-06-27
I have RadTabStrip from Telerik.
In a javascript function I would like to find the index of the selected tab. How is best to do that?
0
Comment
Question by:johnkainn
2 Comments
 
LVL 10

Accepted Solution

by:
Asim Nazir earned 500 total points
ID: 35499253

function Enable()
   {
       var tabStrip = <%= RadTabStrip1.ClientID %>;
       tabStrip.Enable();
       alert(tabStrip.SelectedIndex);
   }

Details
http://www.telerik.com/help/aspnet/tabstrip/tab_the%20radtabstrip%20client%20object.html

I hope it helps.
0
 

Author Comment

by:johnkainn
ID: 35500218
When I do this the alert message is "Undefined".
What am I missing in this?  Attached is the code I am using.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Test_Default2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">

            function MyClick() {
                var tabStrip = <%= RadTabStrip1.ClientID %>;
                alert(tabStrip.SelectedIndex);
            }
        </script>
    </telerik:RadCodeBlock>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <telerik:RadTabStrip ID="RadTabStrip1" runat="server" CssClass="tabset" EnableEmbeddedSkins="False"
        MultiPageID="RadMultiPage1" SelectedIndex="0">
        <Tabs>
            <telerik:RadTab runat="server" CssClass="tab" SelectedCssClass="active" Text="Tab1"
                Selected="True">
            </telerik:RadTab>
            <telerik:RadTab runat="server" CssClass="tab" SelectedCssClass="active" Text="Tab2">
            </telerik:RadTab>
            <telerik:RadTab runat="server" CssClass="tab" SelectedCssClass="active" Text="Tab3">
            </telerik:RadTab>
        </Tabs>
    </telerik:RadTabStrip>
    <input id="Button1" type="button" value="button" onclick="MyClick()" />
    </div>
    </form>
</body>
</html>

Open in new window

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses
Course of the Month17 days, 7 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question