title: Accessing a controller method from javascript file(MVC3)
body: <p>I have a method in the controller which returns a JASON output as given below.</p>
  
  <pre><code>  public JsonResult GetJSONDateData()
      {
  
          JsonResult startDate = new JsonResult();
  
          var Mystartdate = "02/01/2011";
          startDate.Data = Mystartdate;
          startDate.JsonRequestBehavior = JsonRequestBehavior.AllowGet;
  
          return startDate;
  
      }
  </code></pre>
  
  <p>And I try to access this method in javascript using </p>
  
  <pre><code> var query = '';
  query = getDomainURL() + "/ControlelrName/GetJSONDateData";
      jQuery.ajaxSetup({ async: false });
  var startDate = '';  //The max size if nothing is coming from config...
  $.post(query, function (response) {
      startDate = response;
  });
  jQuery.ajaxSetup({ async: true });
  </code></pre>
  
  <p>IS there anything wrong in my functions? I am not getting anything in the response. Pls help</p>
  
  <p>Thanks,
  Adarsh</p>