2016-06-13 18 views
0

我嘗試使用這個AJAX控件ListSearchExtender控制

<ajax:ListSearchExtender ID="lseregiondrop" runat="server" TargetControlID="regiondrop" 
    PromptPosition="Top" QueryPattern="Contains" PromptText="[Select Region]"> 
</ajax:ListSearchExtender> 

當我bulild錯誤顯示

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'. 

回答

2

您需要關閉ScriptManager標籤:

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