I'm trying to call a webmethod inside a aspx page but only the page load event loads.
The webmethod:
<WebMethod()> _
Public Shared Function Test() As String
Return "hello"
End Function
The ajax call:
$.ajax({
type: "POST",
url: "../Custom/Policy.aspx/Test",
dataType: "text",
success: function (data) { alert(data);},
error: function (request, status, error) {
console.log(request.responseText);
}
});
The funny thing is I managed to make it work in the past and even looked at the code but still I can't make it work and now I gave up....
Any assistance will be appreciated.
Thanks in advance.