ListSearchExtender 控件

ListSearchExtender control

我尝试使用这个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'.

您需要关闭 ScriptManager 标签:

<asp:ScriptManager ID="ScriptManager1" runat="server" />