I followed this tutorial to make the fullcalendar in my project: http://studyoverflow.com/asp-mvc/event-calendar-using-jquery-fullcalendar-in-asp-net-mvc/
The only difference is that i already have a project and i added the Events db to my context. This is my view:
<div id="fullcalendar"></div>
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
<script type="text/javascript">
$(function () {
$('#fullcalendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,basicWeek,basicDay'
},
defaultDate: new Date(),
events: "/api/event/"
});
});
</script>
}
And the controller:
public class EventController : ApiController
{
private SGPContext db = new SGPContext();
// GET api/event
public IQueryable GetEvents()
{
return db.Events;
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
db.Dispose();
}
base.Dispose(disposing);
}
}
}
I also added this to my BundleConfig.cs file:
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));
//jQuery fullcalendar plugin css
bundles.Add(new StyleBundle("~/Content/fullcalendar").Include(
"~/Content/fullcalendar.css"));
//jQuery fullcalendar plugin js
bundles.Add(new ScriptBundle("~/bundles/fullcalendar").Include(
"~/Scripts/moment.js", //Include the moment.js
"~/Scripts/fullcalendar.js"));
And of course downloaded the Jquery.Fullcalendar in NuGet. I think i followed all the steps but it doesn't show anything... What can be missing? Thanls