Node is saved as draft in My Content >> Draft
-
Web Method in AJAX
For sending and retrieving data through AJAX calls can be done with the help of web method .
We first create a web method that needs to be invoked when event is fired.
This will be the code behind page :
[WebMethod]
public static string GetDate()
{
return DateTime.Now.ToString();
}
We will create a JS file from which call will be made:
$.ajax({
type: "POST",
url: "PageName.aspx/GetDate",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
$("#divmain").html=msg;
}
});
0 Comment(s)