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 5940953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:02:29+00:00 2026-05-22T16:02:29+00:00

in my javascript I try to call a controller method of the ASP.NET MVC

  • 0

in my javascript I try to call a controller method of the ASP.NET MVC V3 framework, actually I tried these both solutions:

$.get('/Controller/Method', tourID, function (data) {
    $.each(data, function (index, listelement) {
     ...do something with listelement
    });
}, "json");


$.getJSON('/Controller/Method', null, function (data) {
    $.each(data, function (index, listelement) {
     ...do something with listelement
    });
}); 

My Controller method looks like this:

public JsonResult GetList(int id)
{
    Object obj = repository.GetObject(id);
    // obj.Stuff is an EntityCollection
    return Json(obj.Stuff, JsonRequestBehavior.AllowGet);
}

My problem is, the controller function is not going to be called (I have a breakpoint set here). Well if I remove the parameter “id”, it can be called, but the “$.each…” section is not going to be executed. How can I debug the interaction between javascript and ASP.NET, what is going wrong here?

Thanks in advance and best regards,

Artjom

  • 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-05-22T16:02:29+00:00Added an answer on May 22, 2026 at 4:02 pm

    I used the Firebug plugin to find the problem. The list I tried to return in the controller method could not be serialized due to circular dependencies. I solved this by adding the [ScriptIgnore] attribute to navigation properties of the corresponding entity class.

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

Sidebar

Related Questions

I am doing an AJAX call to a controller method on my ASP.Net MVC
I try get the mp3 flash player to work with my javascript on all
when i try to call a javascript function in a dynamically loaded user control,
When I try to call Test function I get an error. How to fix
I am using ASP.NET MVC 3 with the razor view engine. I have the
When I try to call a URL as a pop-up window through JavaScript, after
I am very new to both JavaScript and ActionScript. I am trying to get
How would I fix these errors I get in JSBin? JSBin http://jsbin.com/ebizaj/edit#javascript,html I get
I have an ASP.NET MVC web application running from http://localhost/myappname . From jQuery, I
When I try and call .dataBind() on a Telerik Grid object in javascript, it

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.