I'm trying to figure out how to determine what the baseUrl should be for this ajax webmethod POST.
According to this Sitefinity thread, the baseUrl is the path to the Sitefinity project folder.
In my case, the path should something along the lines of:
"C:\inetpub\Website\Public" but this path is not in the same format as "MyWebForm.aspx/WebMethod"
This seems like a simple problem but before I go testing this out, I want to make sure I'm doing the right thing.
I'd appreciate any suggestions and feedback.
Thanks in advance.
function buttonClick(e) {
e.preventDefault();
$.ajax({
type: "POST",
url: baseUrl + "MyWebForm.aspx/WebMethod",
data: 1,
contentType: "application/json; charset=utf-8",
dataType: "json",
success:
function() {
alert('Success');
},
error:
function (msg) {
alert('Sorry, there was an error, please try again later');
}
});
}