Mpholo Leboea

Mpholo Leboea

  • NA
  • 15
  • 4.5k

JSON not working in asp.net mvc

May 2 2011 5:26 PM

I have downloaded the C# source code for the vedio 14 on this site http://www.asp.net/mvc/videos (or see attached document for the full application) and converted it to mvc 2 and .net 4.0 using visual studio 2010.
The alert box(alert(customer.CustomerName))  in this code is not displaying when clicking the customer link.


$(document).ready(function() {
// alert("test");
$.getJSON("Customer/GetCustomer",null,function(customer){
alert(customer.CustomerName);
});
});

Answers (3)