这是我的代码:
<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>
我知道该片段在片段开头的某些标签没有结束标签。我把它们排除在外的原因是因为它们和它们的结束标签之间有很多代码。此外,据我所知,我的问题是与此代码片段中的 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。正如你所看到的,这两行都有这些部分。有人知道我可以尝试的另一种解决方案吗?提前致谢。