Click here to Skip to main content
15,904,339 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how to set a focus on tab-container's tab-panel in page load

I'm unable to set focus to tab-panel!!


please help



Code:

XML
<asp:Content ID="Content1" ContentPlaceHolderID="CphrEMS" runat="server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <table>
                <tr>
                    <td align="left">
                        <ajax:TabContainer ID="tbVisitors" runat="server" ActiveTabIndex="1" CssClass="ajax__myTab"
                            OnActiveTabChanged="tbVisitors_ActiveTabChanged" AutoPostBack="true"
                            Width="100%">
                            <ajax:TabPanel ID="tbpacVisitors" runat="server">
                                <HeaderTemplate>
                                    <asp:Label ID="lbl" runat="server" Text="<%$ Resources:LocalStrings,AddVisitors %>">
                                    </asp:Label></HeaderTemplate>
                                <ContentTemplate>
                                    <table>
                                        <div class="newRadio">
                                            <div style="float: left; padding: 15px 0 15px 15px;">
                                            </div>
                                        </div>
                                    </table>
                                    <table width="100%">
                                        <tr>
                                            <td align="left" width="25%" >
                                                <asp:Label ID="lblwhom" runat="server" Text="<%$ Resources:LocalStrings,WhomToVisit %>"
                                                    CssClass="label"></asp:Label><br />
                                                <asp:DropDownList ID="ddlwhomtovisit" runat="server" CssClass="longdropdown" AutoPostBack="True"
                                                    OnSelectedIndexChanged="rbtnwhomtovisit_SelectedIndexChanged" TabIndex="1" Width="98%">
                                                    <asp:ListItem Value="1"></asp:ListItem>
                                                    <asp:ListItem Value="2"></asp:ListItem>
                                                    <asp:ListItem Value="3"></asp:ListItem>
                                                </asp:DropDownList>
                                            </td>
Posted
Updated 9-Feb-14 18:12pm
v2
Comments
samit kaneriya 10-Feb-14 0:08am    
pl give some code and first tell me for focus you want to use javascript Or Code Side
Member 10517120 10-Feb-14 0:13am    
I want use any thing .... much more comfortable with C# code..

i needt set focus to next tab

Refer..
XML
var tabContainer = window.Sys.Application.findComponent('<%=tabContainer.ClientID %>');

tabContainer .set_activeTabIndex(1);
 
Share this answer
 
Comments
Member 10517120 10-Feb-14 0:09am    
is it java script... ?

why do i need this!!

I'm not talking about AtiveTabindex..

I need to Set Focus to Next Tab when page Loads
 
Share this answer
 
v3
Comments
Member 10517120 10-Feb-14 0:19am    
Dude I'm asking about Focus... not active Tab index..

My active tabindex is 1 and i need focus to shift from tab1 to tab 0
Member 10517120 10-Feb-14 0:22am    
Tnx for Your Concern.. Im not finding the exact peice of code
karthik Udhayakumar 10-Feb-14 0:30am    
refer the improved solution ..you will get the answer!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900