Note that there are some explanatory texts on larger screens.

plurals
  1. POcould not get json data in jquery in mvc
    text
    copied!<p>I am developing application in asp.net MVC My Script is :</p> <pre><code> $(document).ready ( function() { var officerid = document.getElementById('officerid').value; url = "/TasksToOfficer/Calender/" + officerid; var data= function() { $.ajax( { type: 'GET', url: url , dataType: 'json', data: {'start' : start,'end' : end} }); }; }); </code></pre> <p>I am unable to get data from my controller action : </p> <pre><code> [HttpGet] [AcceptVerbs(HttpVerbs.Get)] public JsonResult Calender(Guid id) { List&lt;TasksToOfficer&gt; officersTasks = null; IList&lt;CalendarDTO&gt; tasksList = new List&lt;CalendarDTO&gt;(); List&lt;TasksToOfficer&gt; officersTasksRecived = null; if (String.Compare(Convert.ToString(Session["Role"]), RolesEnum.Admin.ToString())!=0) { officersTasksRecived = tasks_to_officer_management.GetTasksToOfficers(id); foreach (TasksToOfficer tt in officersTasksRecived) { DateTime dt = Convert.ToDateTime(tt.Date); tasksList.Add(new CalendarDTO { id=tt.Id, title =tt.Description, start = ToUnixTimespan(dt), end = ToUnixTimespan(dt), url =""} ); } } else if (String.Compare(Convert.ToString(Session["Role"]), RolesEnum.Officer.ToString()) != 0) { officersTasksRecived = tasks_to_officer_management.GetTasksToOfficers(id); foreach (TasksToOfficer tt in officersTasksRecived) { DateTime dt = Convert.ToDateTime(tt.Date); tasksList.Add(new CalendarDTO { id = tt.Id, title = tt.Description, start = ToUnixTimespan(dt), end = ToUnixTimespan(dt), url = "" } ); } } JsonResult resultToView = Json(tasksList); return Json(resultToView,JsonRequestBehavior.AllowGet); } </code></pre> <p>What should be the error ? In fact I am trying to attache the events on full calender control. I am picking up the records and building the JSon data in my action. but unable to show it on my calender. what I have to do ? </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload