i am using fullcalendar with ASP.net(C#) in my web-application so i made use of PageMethods to achieve server side behavior for removing and updating an event on calendar. everything works fine when i try update and delete events, i used inline delete icon to delete the events from calendar so clicking on this image div causes the event to delete from database but the changes are not reflecting at the same time on calendar UI i mean i have to refresh the page and the removed event is gone. so now i am willing to call the following code from PageMethod.
$('#calendar').fullCalendar('removeEvents', $("#eventId").val());
Since PageMethodes are static so it does not let me call the above script using RegisterClientScriptBlock or something similar.
Would anyone please help me to call the above script from an static PageMethod decorated with WebMethod attribute. if anything's not clear please let me know.
Thanks!!!
Call it in the success callback of your PageMethod:
PageMethods.DeleteEvent($("#eventId").val(), function(){
$('#calendar').fullCalendar('removeEvents', $("#eventId").val());
});