title: ASP. MVC JsonResult
body: <p>Hello I am trying to pass the parameter id to the a JsonResult. Currently the code below works if I hard code my id and when I do not pass a parameter through.</p>
  
  <p>The code below is for the Events Calendar View </p>
  
  <pre><code>&lt;script&gt;
      $(document).ready(function () {
          $('#calendar').fullCalendar({
              header: {
                  left: "prev,next,today",
                  center:'title',
                  right:''
                  //   right: 'month'
              },
              defaultView: 'month',
              editable:false,
              allDaySlot: false,
              selectable: true,
              slotMinutes: 15,
              firstDay:1,
              events: 'GetEvents/'
          });
      });
  &lt;/script&gt;
  
  &lt;div id='calendar' style="width:90%"&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>JsonResult where the id is currently hard coded I would like to pass this value through when I click the button to load the page e.g. /EventsCalendar/2 </p>
  
  <pre><code>public JsonResult GetEvents(string start , string end) 
  {
      int id = 1; 
      var events = CustomEvents(start , end, id );            
      return Json(rows, JsonRequestBehavior.AllowGet);         
  }
  </code></pre>
  
  <p>Item 2 is the name of the button and Item 1 is the name </p>
  
  <pre><code>@Html.ActionLink(item.Item2, "ShowEvents", new { controller = "Leaves", id = item.Item1 }, new { @Class = "btn btn-primary" })
  
  public ActionResult EventsCalendar()
  {   
      return View(); 
  }
  </code></pre>