getJSON Function Not Entered - Not Working
The GetCats function is called. However, when it return, the getJSON function is never entered. I have tried several ways. Am I doing something wrong, or is my JsonResult invalid?
Thanks.
From Controller Class:
public JsonResult GetCats()
{
// enters and returns fine
List<ListItem> list = new List<ListItem>() {
new ListItem() { Value = "1", Text = "VA" },
new ListItem() { Value = "2", Text = "MD" },
new ListItem() { Value = "3", Text = "DC" }
};
return this.Json(list);
}
From HTML Page:
$.getJSON('/Category/GetCats', null, function (data) {
// alert never reached
alert("hi");
});