问题描述
我需要在gridview内添加tabcontainer,以便从sql server中检索数据.能否帮我做到这一点?
当前,iam在gridview中出现以下错误
"
找不到适合于指定区域性或中性区域性的任何资源.确保在编译时正确地将"AjaxControlToolkit.propertied.resources.resources"嵌入或链接到程序集"AjaxControlToolkit"中,或者确保所需的所有附属程序集都可加载并完全签名. "
这是我给的代码
Hi,
I need to add tabcontainer inside a gridview which retrives data from sql server.Could you please help me to do this?
Currently iam getting the following error in the gridview
"
Couldnot find any resources appropriate for the specified culture or the neutral culture.makesure "AjaxControlToolkit.propertied.resources.resources"was correctly embedde or linkined into assembly"AjaxControlToolkit"atcompile time,or that all the satellite assemblies required are loadable and fully signed."
This is the code i have given
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
PageSize="6" Height="1173px" Width="705px"
onselectedindexchanged="GridView1_SelectedIndexChanged">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<ajaxToolkit:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="2">
<ajaxToolkit:TabPanel runat="server" HeaderText="TabPanel1" ID="TabPanel1">
</ajaxToolkit:TabPanel>
<ajaxToolkit:TabPanel runat="server" HeaderText="TabPanel2" ID="TabPanel2">
</ajaxToolkit:TabPanel>
<ajaxToolkit:TabPanel ID="TabPanel3" runat="server" HeaderText="TabPanel3">
</ajaxToolkit:TabPanel>
</ajaxToolkit:TabContainer>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
[edit]更正的代码块[/edit]
[edit]corrected code block[/edit]
推荐答案
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" PageSize="6"
Height="1173px" Width="705px" DataSourceID="AccessDataSource1">
<Columns>
<asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True"
SortExpression="ID" />
<asp:BoundField DataField="Content" HeaderText="Content" SortExpression="Content" />
<asp:TemplateField>
<ItemTemplate>
<asp:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="1">
<asp:TabPanel ID="TabbPnl1" runat="server">
<HeaderTemplate>
View User Trace
</HeaderTemplate>
<ContentTemplate>
<asp:Panel ID="pnlMain" runat="server">
<asp:TextBox ID="txt" runat="server" Text="panel1"></asp:TextBox></asp:Panel>
</ContentTemplate>
</asp:TabPanel>
<asp:TabPanel ID="TabPanel1" runat="server">
<HeaderTemplate>
View User Trace2
</HeaderTemplate>
<ContentTemplate>
<asp:Panel ID="Panel1" runat="server">
<asp:TextBox ID="TextBox1" runat="server" Text="panel2"></asp:TextBox>
</asp:Panel>
</ContentTemplate>
</asp:TabPanel>
</asp:TabContainer>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/Database1.accdb"
SelectCommand="SELECT * FROM [Table1]"></asp:AccessDataSource>
</div>
</form>
</body>
</html>
这篇关于如何在asp .net的gridview中添加ajax tabcontainer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!