Copy Code code as follows:
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<title></title>
<script charset= "gb1232" src= "Scripts/jquery-1.4.1.min.js" type= "Text/javascript" ></script>
<script type= "Text/javascript" >
function Sys () {
$.post ("Test1.ashx", {"Name": $ ("#text1"). Val ()}, function (data) {
$ ("#text2"). val (data);
//The first scenario, to add the onblur= "sys ()" Event response in Text1
// }
$ (document). Ready (function () {
$ ("#text1"). blur (function () {
$.post ("Test1.ashx", {"Name": $ ("#text1"). Val ()}, function Jy (data) {
$ ("#text2"). val (data);
});
});
)//second clock scheme
</script>
<body>
<input type= "text" id= "Text1"/>
Transformation
<input type= "text" id= "Text2"/>
</body>
The ASPH handler is as follows:
Copy Code code as follows:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
Namespace An asynchronous refresh
{
///<summary>
///test1 Summary description
///</summary>
Public C Lass Test1:ihttphandler
{
public void ProcessRequest (HttpContext context)
{
context. Response.ContentType = "Text/plain";
String name = Context. request["Name"];
Context. Response.Write (name);
}
public bool isreusable
{
Get
{
return false;
}
}
}
}