Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi,

I am currently working on ajax auto complete extender. I want to show list of places using WCF. I have two separate project, one for website and other for WCF and I am using fiddler to trace the request and response.

The project is error free. But when i type something inside the text box, the auto complete list is not displayed. But i can see the response inside fiddler. I am trying to access the WCF service through the ServicePath and Service method property of autocompleteextender as shown below:
ASP.NET
<ajaxControl:AutoCompleteExtender  runat="server" ID="txtAutoCompExtAjax" TargetControlID="txtAutoCompExt" 
            ServicePath="http://localhost:2027/HotelService.svc" ServiceMethod="GetLocation" UseContextKey="true"
                MinimumPrefixLength="1" CompletionInterval="0" CompletionSetCount="20" EnableCaching="true" ContextKey="" >
            </ajaxControl:AutoCompleteExtender>


Below is my WCF config file:
HTML
<system.serviceModel>
    <services>
      <service name="HotelService.HotelService" behaviorConfiguration="HotelBehavior">
        <endpoint address="" binding="webHttpBinding" contract="HotelService.IHotelService" behaviorConfiguration="ServiceAspNetAjaxBehavior">
         </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="HotelBehavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="ServiceAspNetAjaxBehavior">
          <enableWebScript />
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true"  aspNetCompatibilityEnabled="true"/>
  </system.serviceModel>


I tried to google a lot. Please help.
Posted

Just go through the article - Implement ASP.Net AJAX AutoCompleteExtender using WCF Web Service[^].

Just go carefully, see all the configurations are correct in your code or not. Also download the project and try at your end.

I guess you are missing something.
 
Share this answer
 
Comments
linto_11 30-Dec-13 8:40am    
Yes i have gone through this. But if you see carefully inside autocompleteextender control, the service path is the file name and here i am trying to give the link where my WCF is hosted.
Do you see any Error inside FireBug console?
linto_11 31-Dec-13 0:30am    
no error in fire bug...in fact while using fiddler i can see the JSON with the value, but it is not getting displayed.
Okay. Let me try at my end. I will come back to you soon. :)
linto_11 31-Dec-13 2:09am    
thanks awaiting for your reply...:)
 
Share this answer
 
Comments
linto_11 31-Dec-13 0:33am    
thanks for your answer, but i have gone through the link that you have given on WCF. But if you closely examine the 'ServicePath' attribute inside 'autocompleextender' holds the path of the file and if you can see the attribute that i have give is a 'link'. I think some problem with that...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900