【发布时间】:2018-12-29 03:06:33
【问题描述】:
这是我的代码:
<ajaxToolKit:TabPanel ID="mainTabMedicaidData" runat="server" HeaderText="Medicaid Data">
<ContentTemplate>
<ajaxToolKit:TabContainer ID="MedicaidDataSubTabContainer" runat="server">
<ajaxToolKit:TabPanel ID="TabPanel1" runat="server" HeaderText="Search">
<ContentTemplate>
<asp:UpdatePanel ID="MedicaidDataPanel" runat="server" UpdateMode="Always">
<ContentTemplate>
<div class="formRow">
<asp:Label runat="server" ID="uxMedicaidData_StudentNumberLabel" AssociatedControlID="uxMedicaidData_StudentNumber">
Student ID:
</asp:Label>
<asp:TextBox runat="server" ID="uxMedicaidData_StudentNumber" MaxLength="30" Width="80px"></asp:TextBox>
<asp:Label runat="server" ID="uxMedicaidData_SchoolYearLabel" AssociatedControlID="uxMedicaidData_SchoolYear">
School Year:
</asp:Label>
<asp:TextBox runat="server" ID="uxMedicaidData_SchoolYear" MaxLength="30" Width="50px"></asp:TextBox>
<asp:Label runat="server" ID="uxMedicaidData_CategoryLabel" AssociatedControlID="uxMedicaidData_ddCategory">
Category:
</asp:Label>
<asp:DropDownList ID="uxMedicaidData_ddCategory" runat="server"></asp:DropDownList>
<asp:Button runat="server" ID="MedicaidData_Search" Text="Search" width="100px" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
我知道sn-p 在sn-p 开头的某些标签没有结束标签。我把它们排除在外的原因是因为它们和它们的结束标签之间有很多代码。此外,据我所知,我的问题在于此代码 sn-p 中的 1 行或另一行。 当我尝试编译它以运行 Web 应用程序时,我收到以下错误:
TabContainer 不能有子类型 'System.Web.UI.WebControls.Button'。
错误突出显示了这一行:
<ajaxToolKit:TabContainer ID="MedicaidDataSubTabContainer" runat="server">
但由于错误状态容器中不能有按钮,我想知道这行是否与它有关:
<asp:Button runat="server" ID="MedicaidData_Search" Text="Search" width="100px" />
我在网上看了很多解决方案,他们都说容器需要runat="server" 和一个ID。正如你所看到的,这两行都有这些部分。有人知道我可以尝试的另一种解决方案吗?提前致谢。
【问题讨论】:
标签: asp.net ajaxcontroltoolkit system.web.ui.webcontrols