我尝试使用这个ajax控件
<ajax:ListSearchExtender ID="lseregiondrop" runat="server" TargetControlID="regiondrop"
PromptPosition="Top" QueryPattern="Contains" PromptText="[Select Region]">
</ajax:ListSearchExtender>
当我显示错误显示时
The control with ID 'lseregiondrop' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it
现在当我像这样放置脚本管理器
<asp:ScriptManager ID="ScriptManager1" runat="server">
<asp:DropDownList ID="regiondrop" runat="server" AutoPostBack="True"
onselectedindexchanged="regiondrop_SelectedIndexChanged">
</asp:DropDownList>
<ajax:ListSearchExtender ID="lseregiondrop" runat="server" TargetControlID="regiondrop"
PromptPosition="Top" QueryPattern="Contains" PromptText="[Select Region]">
</ajax:ListSearchExtender>
</asp:ScriptManager>
当我构建时显示错误
Type 'System.Web.UI.ScriptManager' does not have a public property named 'DropDownList'.
答案 0 :(得分:2)
您需要关闭ScriptManager
代码:
<asp:ScriptManager ID="ScriptManager1" runat="server" />