I am working with the jQuery fullcalendar plugin and mvc3.
jQuery:
$(document).ready(function () {
var calendar = $('#calendar').fullCalendar({
header: {
left: 'prev, next, today',
center: 'title',
right: 'month, agendaWeek, agendaDay'
},
events: 'CalendarView/GetEvents/'
});
});
Controller (It doesn’t get into this function):
public JsonResult GetEvents(double start, double end)
{
var DateStart = ConvertFromUnixTimestamp(start);
var DateEnd = ConvertFromUnixTimestamp(end);
var JsonRfc = Repo.getCalendar(DateStart, DateEnd);
var ret = JsonRfc.ToArray();
return Json(ret, JsonRequestBehavior.AllowGet);
}
The code inside the controller never gets executed. Does anyone have any insight as to why?
Thanks.
Ensure that the path to your controller/action is correct. Depending on how your app is installed it may or may not be right. As long as your javascript code is inside one of your views you might try with
You definetly should, as @Phil.Wheeler suggested, take a closer look at what will pop up in Firebug / IE Developer Tools / Chrome Developer tools. (or try http://www.fiddler2.com/fiddler2/ if you want something outside of your browser )
The other way you might want to try is retrieving JSON object first with