I haven't used this before so I'm probably missing something, is this even possible?
function myFunc(obj) {
$(document).ready(function () {
$.ajax({
type: "POST",
url: "CMSWebParts_PSS_Test.aspx/CallMe",
data: obj,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
}
});
});
}
And the .cs:
public partial class CMSWebParts_PSS_Test : CMSAbstractWebPart
{ ...
[WebMethod]
public static string CallMe(string data)
{
return card;
}...
}
I keep getting 404. Tried using PageMethods but still getting the same result.
Make your data a string
msgis a wrapper. The requested data is put into a property -> dAlso, call your function
myFuncor use$(document).ready.Update: try moving the success part outside of the initial call, change the name to 'done'.