Is it possible to call a method attributed with [WebMethod] from javascript on a different page? I.e. using the following jquery ajax call from script on a page called PageTwo.aspx:
$.ajax(
{
type: "POST",
url: "pageone.aspx/PageOneMethodOne",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg)
{
//something
}
}
);
PageOne.aspx.cs containing
[WebMethod]
public string PageOneMethodOne()
{
return "hello world";
}