Copy codeThe Code is as follows:
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<Html xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<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 scheme. You must 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-minute plan
</Script>
</Head>
<Body>
<Input type = "text" id = "text1"/>
Conversion
<Input type = "text" id = "text2"/>
</Body>
</Html>
The asph processing program is as follows:
Copy codeThe Code is as follows:
Using System;
Using System. Collections. Generic;
Using System. Linq;
Using System. Web;
Asynchronous refresh of namespace
{
/// <Summary>
/// Summary of test1
/// </Summary>
Public class 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;
}
}
}
}