I implemented a simple autocomplete method using AJAX Autocomplete Extender through this video:
http://www.asp.net/ajax/videos/how-do-i-use-the-aspnet-ajax-autocomplete-control
I am pulling from the web service for my data. Nothing major...But when I am running the application .NET is throwing me this error:
Microsoft JScript runtime error: AjaxControlToolkit requires ASP.NET Ajax 4.0 scripts. Ensure the correct version of the scripts are referenced. If you are using an ASP.NET ScriptManager, switch to the ToolkitScriptManager in AjaxControlToolkit.dll.
This is my code for the textbox that implements extender:
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
<Services&开发者_如何学Cgt;
<asp:ServiceReference Path="~/WebService1.asmx" />
</Services>
</asp:ToolkitScriptManager>
<asp:TextBox ID="TextBox1" runat="server" Height="22px" Width="177px"></asp:TextBox>
<asp:AutoCompleteExtender ID="TextBox1_AutoCompleteExtender" runat="server"
DelimiterCharacters="" Enabled="True" TargetControlID="TextBox1" ServicePath ="~/WebService1.asmx" ServiceMethod ="ReturnEntity" MinimumPrefixLength ="1" CompletionSetCount ="12" EnableCaching = "true">
</asp:AutoCompleteExtender>
I have installed the current AJAX Toolkit. Dont know what is wrong here...
Try to change
<asp:ScriptManager ID="sm" runat="server"></asp:ScriptManager>
to
<ajax:ToolkitScriptManager ID="tsm" runat="server"></ajax:ToolkitScriptManager>
Also take a look at this article: ScriptManager vs. ToolkitScriptManager
精彩评论