本文介绍了如何在asp.net中点击gridview的链接按钮打开tabpanel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的,
我在TabContainer中有三个tabpanel,在第一个tabpanel中有gridView控件,其中有4个字段,in这些字段是linkbutton字段,它绑定了一个数据库字段。
i需要点击那个linkbutton记录然后打开第三个tabpannel。
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.
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">
<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.....
please help me.....
推荐答案
please help me.....
please help me.....
这篇关于如何在asp.net中点击gridview的链接按钮打开tabpanel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!