Ajax Tabs implementation problem .

Posted by SmartDev on Stack Overflow See other posts from Stack Overflow or by SmartDev
Published on 2010-04-14T18:48:13Z Indexed on 2010/04/14 18:53 UTC
Read the original article Hit count: 313

Filed under:

Hi ,

I have Implement ajax tabs and i have four tabs in it . In the four tabs i have four grid views with paging and sorting .The tabs are looking good i can see the grid ,but the problem is my first tab sorting works fine, where if i click on any other tab and click on the grid it goes to my first tab again .

One more thing i want to change the background color of each tab.

Can anyone help please here is my source code:

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:ScriptManager ID="ScMMyTabs"  runat="server">
    </asp:ScriptManager>     
 <cc1:TabContainer ID="TCMytabs" ActiveTabIndex="0"  runat="server">
    <cc1:TabPanel ID="TpMyreq" runat="server" CssClass="TabBackground"    HeaderText="My request">
    <ContentTemplate>
      <table>
        <tr>
          <td>
              <asp:Button ID="btnexportMyRequestCsu" runat="server" Text="Export To Excel" CssClass="LabelDisplay" OnClick="btnexportMyRequestCsu_Click" />
          </td>
      </tr>
        <tr>
            <td>
                 <asp:GridView ID="GdvMyrequest" runat="server" CssClass="Mytabs" BackColor="White" BorderColor="White" BorderStyle="Ridge" BorderWidth="2px" CellPadding="3" CellSpacing="1" GridLines="None" OnPageIndexChanging="GdvMyrequest_PageIndexChanging" OnSorting="GdvMyrequest_Sorting" EmptyDataText="No request found for this user">
                     <RowStyle BackColor="#DEDFDE" ForeColor="Black" />
                     <FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
                     <PagerStyle BackColor="Control" ForeColor="Gray" HorizontalAlign="Left" />
                     <SelectedRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" />
                     <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#E7E7FF" />
                      <PagerSettings Position="TopAndBottom" />
                      <Columns>
                      <asp:TemplateField>
                        <HeaderTemplate>
                        Row No
                        </HeaderTemplate>
                        <ItemTemplate>
                        <%# Container.DataItemIndex + 1 %>
                        </ItemTemplate>
                        </asp:TemplateField>
                        </Columns>
                </asp:GridView>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblmessmyrequestAhk" runat="server" CssClass="labelmess"></asp:Label>
            </td>
        </tr>          
        </table>            
   </ContentTemplate>
    </cc1:TabPanel>
    <cc1:TabPanel ID="TpMyPaymentCc" runat="server"  HeaderText="Payments Credit Card" > 
                <ContentTemplate>
                     <table>
             <tr>
                <td>
                    <asp:GridView ID="GdvmypaymentsCc" runat="server" CssClass="Mytabs" BackColor="White" BorderColor="White" BorderStyle="Ridge" BorderWidth="2px" CellPadding="3" CellSpacing="1" GridLines="None" OnPageIndexChanging="GdvmypaymentsCc_PageIndexChanging" OnSorting="GdvmypaymentsCc_Sorting" EmptyDataText="No Data">
                        <RowStyle BackColor="#DEDFDE" ForeColor="Black" />
                        <FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
                        <PagerStyle BackColor="Control" ForeColor="Gray" HorizontalAlign="Left" />
                        <SelectedRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#E7E7FF" />
                        <PagerSettings Position="TopAndBottom" />
                    </asp:GridView>
                </td>
           </tr>

           <tr>
                <td>
                    <asp:Label ID="lblmessmypaymentsCsu" runat="server" CssClass="labelmess"></asp:Label>
                </td>
           </tr>
    </table>
 </ContentTemplate>
</cc1:TabPanel>
<cc1:TabPanel ID="TpMyPaymentsCk" runat="server"  HeaderText="Payments Check" > 
            <ContentTemplate>
                    <asp:GridView ID="GdvmypaymentsCk" runat="server" CssClass="Mytabs" BackColor="White" BorderColor="White" BorderStyle="Ridge" BorderWidth="2px" CellPadding="3" CellSpacing="1" GridLines="None" OnPageIndexChanging="GdvmypaymentsCk_PageIndexChanging"  OnSorting="GdvmypaymentsCk_Sorting" EmptyDataText="No Data">
                        <RowStyle BackColor="#DEDFDE" ForeColor="Black" />
                        <FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
                         <PagerStyle BackColor="Control" ForeColor="Gray" HorizontalAlign="Left" />
                        <SelectedRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#E7E7FF" />
                        <PagerSettings Position="TopAndBottom" />
                    </asp:GridView>             
            </ContentTemplate>
</cc1:TabPanel>
<cc1:TabPanel ID="TpMyCalls" runat="server" HeaderText="Calls"  >
            <ContentTemplate>
               <table>
         <tr>
             <td>
                 <asp:GridView ID="GdvSelectcallsP" runat="server" CssClass="Mytabs" BackColor="White" BorderColor="White" BorderStyle="Ridge" BorderWidth="2px" CellPadding="3" CellSpacing="1" GridLines="None" OnPageIndexChanging="GdvSelectcallsP_PageIndexChanging" OnRowDataBound="GdvSelectcallsP_RowDataBound" OnSorting="GdvSelectcallsP_Sorting"  >
                     <RowStyle BackColor="#DEDFDE" ForeColor="Black" />
                     <FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
                     <PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" />
                     <SelectedRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" />
                     <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#E7E7FF" />
                       <Columns>
                        <asp:TemplateField>
                        <HeaderTemplate>
                        Row No
                        </HeaderTemplate>
                        <ItemTemplate>
                        <%# Container.DataItemIndex + 1 %>
                        </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>           
                 </asp:GridView>
             </td>
         </tr>
         <tr>
              <td>
                  <asp:Label ID="lblmessselectcallsAhkP" runat="server" CssClass="labelmess"></asp:Label>
              </td>
         </tr>
  </table> 
</ContentTemplate>
</cc1:TabPanel>
    </cc1:TabContainer>
  </asp:Content>

© Stack Overflow or respective owner

Related posts about asp.net-ajax