<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js" type="text/javascript"></script>
<script type = "text/javascript">
function ShowCurrentTime() {
$.ajax({
type: "POST",
url: "default2.aspx/ServerSideMethod",
data: '{}',
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
success: OnSuccess,
failure: function (response) {
alert(response.d);
}
});
return false; // Will stop the event bubbling and thus keep from submitting the form.
}
function OnSuccess(response) {
alert(response.d);
}
</script>
<!--
<asp:Button ID="Button2" runat="server" OnClientClick="return ShowCurrentTime();" Text="New Button" />
Best Regards,
—MRB