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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:57:29+00:00 2026-05-24T19:57:29+00:00

Calling an asp.net mvc3 controller method which returns the results fine (list of an

  • 0

Calling an asp.net mvc3 controller method which returns the results fine (list of an object) and passes the list (c#) to the following jQuery Ajax function:

    //$("#yourtableid > tr").remove();
function getAnswers(qid) {
      var url = "/rankings/getanswers/" + qid;
      $.ajax({
      type: "POST",
      url: url,
      data: {qid: qid}, //"{}",
      dataType: "json",
      success: function(response) {
        var cars = response;
        $('#rankings').empty();
        var i = 0;
        debugger;
        $.each(cars, function(index, car) {
          $('#rankings').append(
           "<tr rorder=\"" + car.Ranking + "\"><td>" 
           + ++i.toString() + "</td><td align=\"left\"><span onclick=\"adjustRank('" 
           + car.Id + "')\" style=\"cursor:pointer;\">" 
           + car.Text + "</span></td><td></td></tr>"
          );
        });
      },
      failure: function(msg) {
        $('#rankings').text(msg);
      }
    });
}

I don’t see anything wrong with this but I get the following error:

Microsoft JScript runtime error: Cannot assign to a function result

  • 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-24T19:57:31+00:00Added an answer on May 24, 2026 at 7:57 pm

    I think ++i.toString() is invalid. What did you want to achieve? (++i).toString() ?

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

Sidebar

Related Questions

Hallo, I have following jquery code for calling ASP.NET MVC controller method that is
Can anyone help? I have an issue with calling a asp.net webservice from jquery..
I'm calling an asp.net webservice with JQuery and ajax, transfering data with json. I'm
I am having issues calling an ASP.NET web service in JQuery. I am basically
I am calling a ASP.NET webservice which is marked as one-way. I wrapped the
I'm using asp.net page that is fully ajaxified (with jquery lib) and calling another
I am calling an ASP.NET Ajax method (e.g. a method tagged with [Ajax.AjaxMethod] )
I'm calling a WebMethod (ASP.NET) via AJAX (jQuery). If I create a version of
How do I go about calling a method on an ASP.NET Web Form page
When calling an ASP.Net PageMethod, we call it as follows: function doSomething(htmlElement) { PageMethods.GetText(onSuccess,

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.