<script src="App_Script/jquery-1.4.3.min.js" type="text/javascript">
</script>
<script type="text/javascript">
$(document).ready(function () {
$("#<%=
btnLogin.clientID %>").click(function () {
$.ajax({
type: "POST",
url: "server-side.aspx/GetCategory",
data: "{}",
contentType: "application/json;
charset=utf-8",
dataType: "json",
async: true,
cache: false,
success: function (msg) {
$('#msg').text(msg.d);
},
error: function (data) { alert("Error"
+ data.d); }
})
return false;
});
});
</script>
HTML
<div id="msg">
</div>
<asp:Button runat="server" ID="btnLogin" />
C#
[WebMethod]
public static string FillRelatedCategory1 ()
{
return " success";
}