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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:54:22+00:00 2026-05-28T19:54:22+00:00

I have a function calling a controller method in MVC3. $.getJSON(‘@Url.Action(LoadCitiesByProvince, Property)’, { id:

  • 0

I have a function calling a controller method in MVC3.

$.getJSON('@Url.Action("LoadCitiesByProvince", "Property")', { id: 1}, function (msg) {
    alert("Data Saved: " + msg);
});

The final rendered Javascript:

$.getJSON('/MySite/Property/LoadCitiesByProvince', { id: 1 }, function (msg) {
alert("Data Saved: " + msg);
}); 

Firebug reports the following error:

s is undefined
[Break On This Error]   

callbackContext = s.context || s,

When I debug my controller method is never hit. I have triple checked the controller method even calling it manually via the url in my browser (in whitch case it works as expected). This is my controller method:

[AcceptVerbs(HttpVerbs.Get)]
public JsonResult LoadCitiesByProvince(string id)
{
    var modelList = this.GetCities(Convert.ToInt32(id));

    var modelData = modelList.Select(m => new SelectListItem()
    {
        Text = m.Description,
        Value = m.Id.ToString(),

    });

    return Json(modelData, JsonRequestBehavior.AllowGet);
}

At this point all I want to see is my controller method being hit and data coming back.

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

    The problem was with the jquery vsdoc javascript file included with MVC3. It causes this error. Simply Changing the javascript include line:

    <script src="@Url.Content("~/Scripts/jquery-1.5.1-vsdoc.js")" type="text/javascript"></script>
    

    to

    <script src="@Url.Content("~/Scripts/jquery-1.5.1.js")" type="text/javascript"></script>
    

    Here is a link to a question about this issue:

    Updating vsDoc to 1.5 breaks all javascript

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

Sidebar

Related Questions

I have controller method in my MVC application that I am calling using the
Hallo, I have following jquery code for calling ASP.NET MVC controller method that is
I have a self calling function. var controller = new (function () { this.func
I have a jqGrid calling a controller action (returning JSON to jqGrid). When my
I have the following AJAX call: $('#FonykerUsernameRegister').blur(function(){ if($(this).val().length > 2) { alert($(this).val()); $.ajax({ url:
I have to pass values from view to controller, controller having action method that
I have a function that is recursively calling itself, and i want to detect
I have a function like this: MyFunction(double matrix[4][4]) {/*do stuff*/} I am calling this
I have a number of iframes calling a function in my main page. Is
So I have a TimerTask task calling a function onTimerComplete() in its run() onTimerComplete()

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.