0
votes

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

1
what .net version you are using? - Muhammad Akhtar
you have to download your .net version compatible version instead 4.0. - Muhammad Akhtar
@Akhtar: I downloaded the current version of AJAX Toolkit. And I am using .NET 4.0 - RG-3
@Akhtar: I got it what you said. I implemented this: <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"> <asp:ServiceReference Path="~/WebService1.asmx" /> </asp:ToolkitScriptManager> - RG-3
But ToolkitScriptManager does not have a public property named 'ServiceReference' - RG-3

1 Answers

2
votes

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