This doesn't seem to work with asp.net pagemethods?
This doesn't seem to work with asp.net pagemethods?
Here's the code:
[code]
$(".dataTable").dataTable({
"bServerSide": true,
"bProcessing": true,
"sAjaxSource": "../../Default.aspx/Test",
"sServerMethod": "POST",
"fnServerParams": function (aoData) {
aoData.push({ "name": "data", "value": JSON.stringify(searchModel) });
}
});
[/code]
When I debug my Default.aspx in VS, which is quite simple:
[code]
protected void Page_Load(object sender, EventArgs e)
{
FunctionName = "Home";
}
[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public static string Test()
{
return JsonConvert.SerializeObject(new { Name = "SomeValue" });
}
[/code]
The breakpoint in Page_Load method can be hit while one in Test method can't whatsoever. Anyone had successful experience retrieving data with PageMethods?
Thanks for any help!
[code]
$(".dataTable").dataTable({
"bServerSide": true,
"bProcessing": true,
"sAjaxSource": "../../Default.aspx/Test",
"sServerMethod": "POST",
"fnServerParams": function (aoData) {
aoData.push({ "name": "data", "value": JSON.stringify(searchModel) });
}
});
[/code]
When I debug my Default.aspx in VS, which is quite simple:
[code]
protected void Page_Load(object sender, EventArgs e)
{
FunctionName = "Home";
}
[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public static string Test()
{
return JsonConvert.SerializeObject(new { Name = "SomeValue" });
}
[/code]
The breakpoint in Page_Load method can be hit while one in Test method can't whatsoever. Anyone had successful experience retrieving data with PageMethods?
Thanks for any help!
This discussion has been closed.
Replies
Allan