title: MVC controller not returning JSON data?
body: <p>I was returning JSON data of a Product from a controller <code>JsonDetailsProduct</code>. This is in turn called using the Jquery.</p>
  
  <p>However, the success function of the Jquery call doesn't seems to be receiving any data. I guess Something is wrong within my controller.</p>
  
  <p>MVC Controller:</p>
  
  <pre><code>    public ActionResult JsonDetailsProduct(int id)
  { 
      Product pdt = NWDC.GetProduct(id); 
      if (pdt == null)
   { 
      // i'm throwing a custom exception here
      throw new RecordNotFoundException(); 
   } 
  else
   { 
      return Json(new { 
      ProductId = prod.ProductID, 
      ProductName = prod.ProductName, 
      UnitPrice = prod.UnitPrice, 
      UnitsInStock = prod.UnitsInStock, 
      Discontinued = prod.Discontinued 
      }, JsonRequestBehavior.AllowGet); 
    } 
  } 
  </code></pre>
  
  <p>the JQuery call:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).ready(
    function(){   
      alert("About to make the call"); // just added it for my debugging purpose
     $.getJSON( "/SlimProductServices/JsonDetailsProduct",  
                 data:{id:$('#txtProductID').val()},
      function(productData)
      {
        alert(productData);
      }
      );
   }
  );
  </code></pre>
  
  <p></p>
  
  <p>Any thoughts where things are setup wrongly and whether any issue in Jquery Call also present ??</p>
  
  <p><strong>EDIT</strong>
  Also, I corrected the  <code>data</code> parameter of my Jquery call, but the first Alert box shows up after that blank pop ups.</p>