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

Indexing Issue Tabs not change, page does.

4 Answers 55 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Stephan
Top achievements
Rank 1
Stephan asked on 17 Jan 2012, 09:02 PM
I have set up my tabcontrol, but when it runs it never moves off of the first one.  I think it has something to do with the
selectedindex="0", but the builder didn't put anything in for that.  I tried the Javascript I found on here but that just generates
an error that tabstrip.get_element())is null.

<telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
</telerik:RadScriptManager>
<telerik:RadTabStrip ID="RadTabStrip1" runat="server" SelectedIndex="0"
    ontabclick="RadTabStrip1_TabClick" Skin="Black">
    <Tabs>
        <telerik:RadTab runat="server" NavigateUrl="~/Default.aspx"
            Selected="True" Text="Home">
            <Tabs>
                <telerik:RadTab runat="server" NavigateUrl="~/Careers.aspx"
                    Text="Careers">
                </telerik:RadTab>
                <telerik:RadTab runat="server" NavigateUrl="~/ContactUs.aspx" 
                    Text="ContactUs">
                </telerik:RadTab>
                <telerik:RadTab runat="server" NavigateUrl="~/About.aspx" 
                    Text="About Us">
                </telerik:RadTab>
            </Tabs>
        </telerik:RadTab>
        <telerik:RadTab runat="server" NavigateUrl="~/Service.aspx"
             Text="Services">
            <Tabs>
                <telerik:RadTab runat="server" NavigateUrl="~/GetAQuote.aspx" 
                    Text="Get A Quote">
                </telerik:RadTab>
            </Tabs>
        </telerik:RadTab>
        <telerik:RadTab runat="server" NavigateUrl="~/Products.aspx"
             Text="Products">
            <Tabs>
                <telerik:RadTab runat="server" NavigateUrl="~/pads.aspx"  Text="Pads">
                </telerik:RadTab>
                <telerik:RadTab runat="server" NavigateUrl="~/holiday1.aspx" 
                    Text="Holiday Cards">
                </telerik:RadTab>
            </Tabs>
        </telerik:RadTab>
        <telerik:RadTab runat="server" NavigateUrl="~/Resources.aspx"
             Text="Resources">
        </telerik:RadTab>
        <telerik:RadTab runat="server" NavigateUrl="~/Uploadafile.aspx"
             Text="Up Load A File">
        </telerik:RadTab>
        <telerik:RadTab runat="server" BackColor="Transparent" Font-Bold="True"
            ForeColor="Red" Text="On-line Specials" NavigateUrl="~/Specials.aspx">
        </telerik:RadTab>
    </Tabs>
</telerik:RadTabStrip>
<script type="text/javascript">
    function pageLoad() {
        var tabstrip = $find("RadTab");
        $telerik.$("a", tabstrip.get_element()).bind("focus", function () {
            var index = $telerik.$("a", tabstrip.get_element()).index(this);
            tabstrip.get_tabs().getTab(index).set_selected(true);
        });
    }
</script>

4 Answers, 1 is accepted

Sort by
0
Kate
Telerik team
answered on 20 Jan 2012, 12:24 PM
Hi Stephan,

Can you please elaborate on your scenario? What is the functionality that you trying to achieve?

All the best,
Kate
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Stephan
Top achievements
Rank 1
answered on 20 Jan 2012, 03:46 PM
If my first tab is called "Home" it is lit up and I can see my sub tabs.  If I click on the second tab "Service" it does not lite up, Home is still the active tab and the screen below changes to display service information.  I need to get the other tabs to become active. 
0
Stephan
Top achievements
Rank 1
answered on 20 Jan 2012, 07:56 PM
Here is what I have been able to determine.
I have this in the HTML portion
<telerik:RadTabStrip ID="RadTabStrip1" runat="server" SelectedIndex="0"
                    ontabclick="RadTabStrip1_TabClick" Skin="Black">
                    <Tabs>
                        <telerik:RadTab runat="server" NavigateUrl="~/Default.aspx"
                            Selected="True" Text="Home">

and i have this in my .CS file
protected void RadTabStrip1_TabClick(object sender, Telerik.Web.UI.RadTabStripEventArgs e)
       {
           RadAjaxManager1.Alert("You clicked on " + @"'" + e.Tab.Value + @"'");
I have a break stop on the entery point and on the RadAjaxManager1.Alert and when i click on any of my tabs it does not break.  This tels me it is nut fireing or detecting  the "ontabclick="
0
Kate
Telerik team
answered on 21 Jan 2012, 09:53 AM
Hi Stephan,

Make sure that when using AjaxManager you update both the page that needs to be loaded along with the RadTabstrip so that you can get the clicked tab active. Do you use any user controls and/or master and content pages? If so, I would suggest that you take a look at the following help article as well:
  • http://www.telerik.com/help/aspnet-ajax/ajax-ajaxmanager.html
  • http://www.telerik.com/help/aspnet-ajax/ajax-ajaxmanagerproxy.html

In case this does not help. I would recommend that you open a support ticket and send me a simplified runnable project that I can debug locally and help you out.

Greetings,
Kate
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
TabStrip
Asked by
Stephan
Top achievements
Rank 1
Answers by
Kate
Telerik team
Stephan
Top achievements
Rank 1
Share this question
or