I'm not sure if this belongs on this forum, but if anyone is still using AjaxPro, I'm trying to get it to work with jQuery. I keep getting errors returned similar to this one: null; r.error = {"Message":"wor d s","Type":"Syst em.NotSupported Exception"};/*. Below is the relevant code. Thanks for your help.
C# code:
.JS Code
C# code:
Code:
using AjaxPro;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//load ajax.net files
string path = "/ajaxpro/_Default,";
path += typeof (_Default).Assembly.FullName.Split(',')[0];
path += ".ashx";
Page.RegisterHiddenField("ajaxProPath", path);
}
[AjaxPro.AjaxMethod()]
public int deleteService(int lineNumber)
{
return lineNumber;
}
}
Code:
$(document).ready(function()
{
$("img[@id*=delete]").click(function()
{
var btnID = $(this).attr('id');
btnID = btnID.substring(6, btnID.length);
if (confirm('Are you sure you want to delete service # ' + btnID + '?'))
{
$.ajax({
type: "POST",
url: $("#ajaxProPath").attr('value'),
data: {s: btnID},
beforeSend: function(xhr)
{
xhr.setRequestHeader("X-AjaxPro-Method", "deleteService");
},
success: function(s)
{
alert(s);
}
});
}
});
});
Comment