i implementing full calendar 2.6.1 in asp.net project, , not able display events in calendar. when debugged it, found values coming database not displaying. when debugged in ie, showed errors in jquery files follows:
this default.aspx page
<%@ page language="c#" autoeventwireup="true" codebehind="default.aspx.cs" inherits="emptyweb.default" %> <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <!--fullcalendar dependencies--> <script src="scripts/lib/jquery.min.js"></script> <%--jquery v2.1.4--%> <script src="scripts/lib/jquery-ui.custom.min.js"></script> <%--jquery ui - v1.11.2 - 2014-10-17--%> <script src="scripts/lib/jquery-ui.js"></script> <%--jquery ui - v1.11.4 - 2015-03-11--%> <script src="scripts/lib/moment.min.js"></script> <%--version : 2.11.0--%> <script src="scripts/fullcalendar.js"></script> <%--fullcalendar v2.6.1--%> <link href="scripts/fullcalendar.css" rel="stylesheet" /> <%--fullcalendar v2.6.1--%> <link href="scripts/fullcalendar.print.css" rel="stylesheet" media="print" /> <%--fullcalendar v2.6.1--%> <link href="scripts/lib/cupertino/jquery-ui.min.css" rel="stylesheet" /> <%--jquery ui - v1.11.2 - 2014-10-16--%> <script type="text/javascript"> var currentupdateevent; var addstartdate; var addenddate; var globalallday; function selectdate(start, end, allday) { $('#adddialog').dialog('open'); addstartdate = start; addenddate = end; globalallday = allday; } $(document).ready(function () { var adddialogue = $('#adddialog'); adddialogue.dialog({ autoopen: false, modal: true, buttons: { 'add': function () { }, 'cancel': function () { adddialogue.dialog('close'); } } }); var calendar = $('#calendar').fullcalendar( { header: { left: 'prev,next today', center: 'title', right: 'month,agendaweek,agendaday' }, selectable: true, editable: true, eventlimit: true, select: selectdate, selecthelper: true, events: "jsonresponce.ashx", //[ // { // "title": "all day event", // "start": "2016-04-01" // }, // { // id: '3', // title: 'shiftin', // status: '', // type: '', // start: '2016-04-05', // end: '2016-04-05', // allday: false, // description: '' // } //] }); }); </script> <style type="text/css"> body { margin: 40px 10px; padding: 0; font-family: "lucida grande",helvetica,arial,verdana,sans-serif; font-size: 14px; } #calendar { max-width: 900px; margin: 0 auto; } </style> </head> <body> <!--fullcalendar container div--> <div id="calendar"> </div> <div id="adddialog" title="add event"> <table> <tr> <td>select eventtype:</td> <td> <select id="ddlshifts"> <option value="--select--">--select--</option> <option value="shiftin">shiftin</option> <option value="shiftout">shiftout</option> <option value="breaktime">breaktime</option> <option value="traveltime">traveltime</option> <option value="leave">leave</option> </select> <br /> </td> </tr> <tr id="type" style="display: none"> <td>select task/fault:</td> <td> <select id="ddltypes"></select> </td> </tr> <tr id="desc" style="display: none"> <td>description:</td> <td> <textarea id="addeventdesc" cols="30" rows="3"></textarea> </td> </tr> <tr id="from" style="display: none"> <td>from :</td> <td> <input type="text" id="addeventstartdate" placeholder="mm/dd/yyyy hh:mm:ss am/pm" style="width: 220px" /> </td> </tr> <tr id="to" style="display: none"> <td>to :</td> <td> <input type="text" id="addeventenddate" placeholder="mm/dd/yyyy hh:mm:ss am/pm" style="width: 220px" /> </td> </tr> <tr style="display: none"> <td>name:</td> <td> <input id="addeventname" type="text" size="30" /> <br /> </td> </tr> </table> </div> <script type="text/javascript"> </script> <%--</form>--%> </body> </html>
and jsonresponse.ashx page:
public void processrequest(httpcontext context) { context.response.contenttype = "application/json"; datetime start = new datetime(1970, 1, 1); datetime end = new datetime(1970, 1, 1); //start = start.addseconds(double.parse(context.request.querystring["start"])); //end = end.addseconds(double.parse(context.request.querystring["end"])); start = convert.todatetime(context.request.querystring["start"]); end = convert.todatetime(context.request.querystring["end"]); string result = string.empty; result += "["; list<int> idlist = new list<int>(); foreach (employee cevent in employeedao.getevents(start,end)) { result += convertcalendareventintostring(cevent); idlist.add(cevent.event_id); } if (result.endswith(",")) { result = result.substring(0, result.length - 1); } result += "]"; //store list of event ids in session, can accessed in web methods //context.session["idlist"] = idlist; context.response.write(result); }
what's causing errors, , how can fix it? beginner in jquery.
what version of internet explorer using?
your code mentions using jquery 2.1.4
, if using older version of internet explorer (< 9), need use 1.x
versions of library 2.x
version using no longer supports older browsers.
you might try replacing jquery reference older 1 cdn check if resolves issue , if so, use older version instead:
<script src="https://code.jquery.com/jquery-1.11.3.js"></script>
Comments
Post a Comment