Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8329829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:55:29+00:00 2026-06-09T01:55:29+00:00

I have my webservice method like below: <WebMethod()> _ Public Function TravelMeansList(ByVal prefix As

  • 0

I have my webservice method like below:

 <WebMethod()> _
    Public Function TravelMeansList(ByVal prefix As String) As List(Of HRM_travellingMeans)
        Dim ctx As New HRMEntities
        Dim query = From c In ctx.HRM_travellingMeans Where c.name.ToUpper.StartsWith(prefix) Select c

        If query.Count > 0 Then
            Return query.ToList()
        Else
            Return Nothing
        End If

    End Function

and my script like below

<script type="text/javascript">
     $(document).ready(function () {

         $("#<%=travelmeansTextBox.ClientID %>").autocomplete({


             source: function (request, response) {
                 $.ajax({
                     url: '<%=ResolveUrl("../../services/ApplicationService.asmx/TravelMeansList") %>',
                     data: "{ 'prefix': '" + request.term + "'}",
                     dataType: "json",
                     type: "POST",
                     contentType: "application/json; charset=utf-8",
                     dataFilter: function (data) { return data; },
                     success: function (data) {
                         response($.map(data.d, function (item) {
                             return Json({

                                    value: item.name
                             })
                         }))
                     },
                     error: function (response) {
                         alert(response.responseText);
                     },
                     failure: function (response) {
                         alert(response.responseText);
                     }
                 });
             },
             select: function (e, i) {

             },
             minLength: 1
         });




     });
    </script>

My problem is that anytime i try to type any letter in my textbox i get this error

A circular reference was detected while serializing an object of type \u0027System.Data.Metadata.Edm.AssociationType\u0027.”,”StackTrace”:” at System.Web.Script.Serialization.JavaScriptSerializer.SerializeValueInternal(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat, MemberInfo currentMember)\r\n at System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat, MemberInfo currentMember)\r\n at System.Web.Script.Serialization.JavaScriptSerializer.SerializeCustomObject(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat)\r\n at System.Web.Script.Serialization.JavaScriptSerializer.SerializeValueInternal(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat, MemberInfo currentMember)\r\n at System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat, MemberInfo currentMember)\r\n at System.Web.Script.Serialization.JavaScriptSerializer.SerializeEnumerable ……

What am I doing wrong.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T01:55:30+00:00Added an answer on June 9, 2026 at 1:55 am

    The problem may lie with the JSON serialization of the Entity Framework object. Refer to this article:

    http://mytechworld.officeacuity.com/index.php/2010/02/serializing-entity-framework-objects-into-json-using-asp-net-mvc/

    The author here suggests that you use a JSONResult object if you are using ASP.NET MVC, though I’m not sure how well that would play with jQuery Autocomplete.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some sample webservice like below, <WebMethod()> _ Public Function ExecuteCMD() As Boolean
I have webservice, with method: [WebMethod] public byte[] GetFile(string FName) { System.IO.FileStream fs1 =
I have a JAX-WS WebService like this: public class ParentClass{ public String str1; }
I have a simple web service like this: @WebService public class MyWebService { @WebMethod
I have to map a REST Webservice URL like http://server:8080/application/service/customer/v1 to createCustomer method in
I have a web method like this as part of a web service public
i have written the code like below public class SplashScreen extends BaseActivity{ public void
I have an ASP.NET webservice method that returns a generics list (List'<'Construct>) serialized as
I have a webservice function that returns something like the following: New Orleans, Louisiana
I have a webservice that calls a method that returns a generic list of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.