Hi
I have the following on my Calender.aspx code behind:
[WebMethod]
public static void saveTask(string DATE, int IDEVENT)
{
using (ProjectManagementEntities db = new ProjectManagementEntities())
{
var updateTask = db.tb_Task.FirstOrDefault(x => x.Id == IDEVENT);
updateTask.StartDate = Convert.ToDateTime(DATE);
db.SaveChanges();
}
}
and the following script:
function saveTask(theDATE, theIDEVENT) {
$.ajax({
type: "POST",
url: "Calender.aspx/saveTask",
data: JSON.stringify({ date : theDATE, id : theIDEVENT }),
dataType: "json",
contentType: "application/json; charset=utf-8",
success: function (data) {
alert('Task Updated Successfully.');
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert("Error");
}
});
};
The problem is I can't debug the webMethod saveTask, i put a breakpoint but t doesn't even hit the page. It seem the script does not hit the webMethod so can you please assist.
Thanks.
Manas MohapatraPosted Jun 6, 2017, 9:32 AM
Sbonga MathobelaPosted Jun 6, 2017, 9:44 AM
Pooja DixitPosted Jun 6, 2017, 7:59 AM