I'm trying to use Ajax Control Toolkit's Autocomplete extender with a WCF Service.
This question is almost what I'm looking for, one of the answers points to a tutorial but I can't get it to work.
In my solution I have a web form application project and a WCF service library project.
One of the properties of the Autocomplete extender is ServicePath
which the tutorial points to a svc file:
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div>
<asp:TextBox runat="server" ID="myTextBox" Width="300" autocomplete="off" />
<ajaxToolkit:AutoCompleteExtender
runat="server"
BehaviorID="AutoCompleteEx"
ID="autoComplete1"
TargetControlID="myTextBox"
ServicePath="Autocomplete.svc"
ServiceMethod="GetCompletionList"
MinimumPrefixLength=开发者_C百科"0"
CompletionInterval="1000"
EnableCaching="true">
</ajaxToolkit:AutoCompleteExtender>
</div>
</form>
Right now in ServicePath
I'm pointing to the http address (http://localhost:8731/Design_Time_Addresses/WebApp.WcfServiceLibrary/ProductService/
) that my WCF Service is running, but it just don't works.
Is it the server or the client that isn't behaving properly?
Here are some tips on how to go about resolving your problem:
- Are you able to get the WCF service to work independently from the AJAX control? To do this, you may need to hand-craft an HTTP request to test it out.
- Are you able to get the AJAX control to create the right HTTP request? Try capturing it with Fiddler to see if it properly formed for what the WCF service is expecting.
精彩评论