you need to make your page method like this...
make sure it will static with public identifier.
[WebMethod]
public static void YouPageMethod()
{
}
and if you want to call that method on your page load event then you need to call it like this....
<script type="text/javascript">
$(document).ready(function () {
$.ajax({
type: "POST",
url: "Default.aspx/YouPageMethod",
data: "",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (result) {
alert('Method Called Sucess fully');
},
error: function (result) {
alert("error " + result);
}
});
});
</script>
if you need to pass parameter to your method then use data like this, but one thing parameter name is same as your method parameter name.
data:"{ParamterName:'VALUE',ParamterName2:'Value'}",
but one more thing you can not access your form control like grid or text box in side your web method as it is static.