Here am calling a web method on click event. but am getting the error as inernal server error. here am calling this click event from dynamically created button . here i want to fire any one method.
page method is not firing.but ajax method is returning above error. in this page there r other 2 pagemethods r there. the other pagemethods r firing but this page method is not firing.
<script type="text/javascript">
$(document).ready(function () {
$('#contaner_wrapper').css("height", "100%");
$(document).on('click', '.fc-button-prev a span', function () {
//alert($("#calendar").fullCalendar('getView').start.toString());
var abc = $("#calendar").fullCalendar('getView').start.toString();
var ab = $("#calendar").fullCalendar('getView').end.toString();
// PageMethods.EventDetails('E72', onSucess, onError);
// PageMethods.Displaymonthevents('E72', onSucess, onError);
$.ajax({
url: '/ViewEvents.aspx/Displaymonthevents',
type: 'POST',
data: 'hi',
contentType: 'application/json; charset=utf-8',
dataType: 'json',
async: false,
success: function (data) {
alert(data.d);
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert(errorThrown);
}
});
function OnSuccess(r) {
alert(r);
}
function OnFailure(r) {
alert(r._message);
}
});
$(document).on('click', '.fc-button-next a span', function () {
// Displaymonthevents();
alert($("#calendar").fullCalendar('getView').start.toString());
var abc = $("#calendar").fullCalendar('getView').start.toString();
var ab = $("#calendar").fullCalendar('getView').end.toString();
jQuery.ajax({
url: "ViewEvents.aspx/EventDetails",
type: "POST",
data: "hi",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
alert(data.d);
}
});
});
$(".fc-button-prev a span").trigger('click');
$(".fc-button-next a span").trigger('click');
});
</script>
c#
[System.Web.Services.WebMethod(EnableSession = true)]
public static List<Events> Displaymonthevents(string eventdata1)
{
List<Events> events;
BEvents obj = new BEvents();
obj.ClubKey = (int)HttpContext.Current.Session["Ckey"];
DataTable DT = obj.View();
{..........}
return events;
}