0

I'm using Fullcalendar.

I have only one feature left to be implemented, which is when event dynamically bind from code behind,and i want to call an .ashx page, both are working on event property. I would like to know how I write this.

Here is my code

          var calendar = $('#calendar').fullCalendar({
                theme: true,
                header: {
                    left: 'prev,next today',
                    center: 'title',
                   right: ''
                },  
                defaultView: 'resourceDay',      
                eventClick: updateEvent,
                selectable: true,
                selectHelper: true,
                select: selectDate,
                editable: true,
                resources: [
                <%=resourcestring %>
                ],
              events: "JsonResponse1.ashx",
              events: [
                <%=eventstring %>
                ],            
                minTime: 7, 
                maxTime: 24, 
                firstDay:1,  
                eventDrop: eventDropped,
                eventResize: eventResized
        }); 

But this not working fine. Events binded, but does not call .ashx page. How can i write both events? I want to bind events and call .ashx page.

1 Answer 1

1

You can trigger the events as javascript function in which you can send the request to your .ashx file

$('#calender').fullCalendar({

   weekMode: 'liquid',    
   header: {
   left: 'prev,next today',
   center: 'title',
   right: 'month,agendaWeek,agendaDay'
},

  events: function (start, end, callback) {      
   form_data["startDate"] = start;
   form_data["endDate"] = end;
   $.ajax({
          url: '/xyz.ashx',
          data: form_data,
          type: 'POST',
          success: function (response) {
             console.log(response);
             var events = response["events"];
             callback(events);
          }
         });
     }
});//fullcalendar
3
  • i want to include this one also events: [ <%=eventstring %> ],
    – Monica
    Commented Dec 27, 2013 at 13:26
  • If you want to take advantage of multiple sources i would sugest the use of eventSources Commented Dec 28, 2013 at 10:29
  • Also take a look @ this thread Commented Dec 28, 2013 at 10:36

Not the answer you're looking for? Browse other questions tagged or ask your own question.