Описание вызова ниже, пример взят отсюда и немного модифицирован.
Aspx страница
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<script src="jquery-1.3.2.min.js" type="text/javascript"></script>
<script type = "text/javascript">
function ShowCurrentTime() {
$.ajax({
type: "POST",
url: "Default.aspx/GetDocStatus",
data: '{name: "' + $("#<%=txtUserName.ClientID%>")[0].value + '" }',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: OnSuccess,
failure: function (response) {
alert(response.d);
}
});
}
function OnSuccess(response) {
// alert(response.d);
document.getElementById("demo").innerHTML = response.d;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div style="height: 427px"/>
Your Name :
<asp:TextBox ID="txtUserName" runat="server"></asp:TextBox>
<input id="btnGetTime" type="button" value="Show Current Time"
onclick = "ShowCurrentTime()" /><br />
<asp:Label ID="LabelRefresh" runat="server" Text="Label"></asp:Label>
<br />
<br />
<p id="demo">Результат</p>
</form>
</body>
</html>