Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
dear all,


I have three tabpanel in a TabContainer, in first tabpanel have gridView control which have 4 field, in these field one is linkbutton field which bound a database field .


i need when i click that linkbutton record then its open the 3rd tabpannel.

XML
my code is given below..
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <asp:ToolkitScriptManager ID="AssetMasterScriptManager" runat="server">
       </asp:ToolkitScriptManager>
        <div class="ContentClass">
    <asp:TabContainer ID="AssetTabContainer" runat="server" CssClass="Tab"  Width="794px" Height="290px">
   <asp:TabPanel ID="OverviewTab"  runat="server" ScrollBars="Auto" HeaderText="Overview" >
   <ContentTemplate>
   <div style="height: 383px">
    &nbsp;<br />
   <table align="center">
   <tr>
   <td >
   <asp:GridView ID="AssetGridView" runat="server" AutoGenerateColumns="False"
           DataKeyNames="AssetID" DataSourceID="GridViewAsset" AllowPaging="True"
           Width="712px">
         <AlternatingRowStyle CssClass="GridAlternateRow" />
         <Columns>
       <asp:TemplateField HeaderText="Asset ID">
         <ItemTemplate>
          <asp:Label ID="Label1" runat="server" Text='<%# Bind("AssetID") %>'></asp:Label>
           </ItemTemplate>
           <FooterTemplate>
          </FooterTemplate>
        </asp:TemplateField>
         <asp:TemplateField HeaderText="Asset Description">
         <ItemTemplate>
           <asp:LinkButton ID="btnLink" runat="server" Text='<%# Bind("AssetDescription") %>' CommandArgument='<%# Bind("AssetID")%>'  >LinkButton</asp:LinkButton>
         </ItemTemplate>
           <FooterTemplate>
          </FooterTemplate>
        </asp:TemplateField>
        <asp:TemplateField  HeaderText="Vendor Invoice Number">
         <ItemTemplate>
         <asp:Label ID="Label2" runat="server" Text='<%# Bind("VendorInvoiceNumber") %>'></asp:Label>
           </ItemTemplate>
           <FooterTemplate>
          </FooterTemplate>
        </asp:TemplateField>
          <asp:TemplateField HeaderText="Baan Asset Description">
         <ItemTemplate>
               <asp:Label ID="Label3" runat="server" Text='<%# Bind("BaanAssetDescription") %>'></asp:Label>
           </ItemTemplate>
           <FooterTemplate>
          </FooterTemplate>
        </asp:TemplateField>
          <asp:TemplateField  HeaderText="Remarks">
         <ItemTemplate>
             <asp:Label ID="Label4" runat="server" Text='<%# Bind("Remarks") %>'></asp:Label>
           </ItemTemplate>
           <FooterTemplate>
           </FooterTemplate>
        </asp:TemplateField>
       </Columns>
         <FooterStyle CssClass="Gridfooter" />
         <HeaderStyle CssClass="GridHeader" />
         <RowStyle CssClass="GridRow" />
       </asp:GridView>
       <asp:SqlDataSource ID="GridViewAsset" runat="server"
           ConnectionString="<%$ ConnectionStrings:DeemahAssetConnectionString %>"
           SelectCommand="SELECT [AssetID], [AssetDescription], [VendorInvoiceNumber], [BaanAssetDescription], [Remarks] FROM [AssetMaster]">
       </asp:SqlDataSource>
   </td> </tr> </table></div>
   </ContentTemplate>
    </asp:TabPanel>
 <asp:TabPanel ID="Update"  runat="server" ScrollBars="Auto"  HeaderText="Update">
   <ContentTemplate>
    <asp:Label ID="assetID" runat="server" Text="Asset ID"></asp:Label>
    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    <asp:Label ID="OemSerialNumber" runat="server" Text="OemSerialNumber"></asp:Label>
    <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
    <asp:Label ID="AssetDescription" runat="server" Text="Asset Description"></asp:Label>
    <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
    <asp:Label ID="VendorInvoiceNumber" runat="server" Text="Vendor InvoiceNumber"></asp:Label>
    <asp:TextBox ID="TextBox4" runat="server"></asp:TextBox>
    <asp:Label ID="BaanAssetDescription" runat="server" Text="BaanAssetDescription"></asp:Label>
    <asp:TextBox ID="TextBox5" runat="server"></asp:TextBox>
     <asp:Label ID="Remarks" runat="server" Text="Remarks"></asp:Label>
    <asp:TextBox ID="TextBox6" runat="server"></asp:TextBox>
    <asp:Button ID="update" runat="server" Text="update"></asp:Button>
    </ContentTemplate>
   </asp:TabPanel>
   </asp:TabContainer>
   </div>
</asp:Content>
i need when i click Gridview LinkButton 'btnLink' then its navigate the 'update panel' with that record id and all table data load in 'Update' tabpanel.
please help me.....



please help me.....
Posted
Updated 16-Aug-17 1:40am
v2

by clicking linkbutton open record for selected ids and fill that record's information to page in respective controls and set tab container's active tab to 3rd tab either by javascript or directly by c#.
 
Share this answer
 
AssetTabContainer.ActiveTabIndex=2;
use this at cs page
 
Share this answer
 
v2
Comments
Graeme_Grant 16-Aug-17 9:28am    
Ummm... Do you think that he is still waiting for an answer 6 YEARS later?!? You are better off answering current questions that need assistance rather than tombstoned ones...

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