gpt4 book ai didi

Asp.net:ScriptManager 不工作

转载 作者:搜寻专家 更新时间:2023-10-30 23:19:17 25 4
gpt4 key购买 nike

我正在尝试从另一个下拉列表填充一个下拉列表(过滤数据)我知道我想制作一个脚本管理器,但它给了我一个错误:

The control with ID '' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it.

这是我的代码:

 <td>School</td>
<td>
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:DropDownList ID="SchoolRegister" runat="server" AutoPostBack="True"
DataSourceID="SqlDataSource1" DataTextField="SchoolName" DataValueField="ID">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:DanielConnectionString %>"
SelectCommand="SELECT * FROM [Schools]"></asp:SqlDataSource>
</td>
</tr>
<tr>
<td>Class</td>
<td>
<asp:ScriptManager ID="ScriptManager2" runat="server" />
<asp:DropDownList ID="ClassRegister" runat="server"
DataSourceID="SqlDataSource2" DataTextField="ClassName" DataValueField="ID">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:DanielConnectionString %>"
SelectCommand="SELECT * FROM [Class] WHERE ([SchoolID] = @SchoolID)">
<SelectParameters>
<asp:ControlParameter ControlID="SchoolRegister" Name="SchoolID"
PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
</td>
</tr>

谢谢。

最佳答案

您的页面上有多个 ScriptManager 控件。你只需要一个,它应该放在页面顶部附近。

关于Asp.net:ScriptManager 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8661381/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com