Put these codes in aspx page Call the function DemoAjaxCall() button click
<script type="text/javascript">
function DemoAjaxCall() {
$.ajax({
type: "post",
data:"{xyz:'"+23+"'}",
url: "WebForm1.aspx/DemoAjaxCall",
contentType: "application/json; charset=utf-8",
dataType: "json"
});
}
</script>
In aspx.cs page write these bellow code.
[WebMethod]
public static int DemoAjaxCall(int abc)
{
return 1;
}