hey buddy , i m attaching code please refer to it which will help you.
i have called server side method on textbox1 text change jquery.
and it gets response from server side method and updates ui accordingly.
i hope you will get hint . ;)
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Untitled Page</title>
<script src="jquery-1.4.2.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#TextBox1").keyup(function() {
var email = $("#TextBox1").val();
$.ajax({
type: "POST",
url: "Default.aspx/Check",
data: "{'value1': '" + email +"'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
success: function(response) {
$('#myDiv').text(response.d);
},
error: function() {
alert("Error");
}
});
$.ajax(options);
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div id="myDiv"></div>
<div>
<asp:label id="lbl1" runat="server" text="Label1" xmlns:asp="#unknown"></asp:label>
<asp:textbox id="TextBox1" runat="server" xmlns:asp="#unknown"></asp:textbox>
<asp:label id="Label1" runat="server" text="Label2" xmlns:asp="#unknown"></asp:label>
<asp:textbox id="TextBox2" runat="server" xmlns:asp="#unknown"></asp:textbox>
</div>
</form>
</body>
</html>
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
[WebMethod]
public static string Check(string value1)
{
return "DateTime : "+ DateTime.Now.TimeOfDay.ToString() + " Hello " + value1;
}
}