国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > AJAX > 正文

asp.net jquery+ajax異步刷新實現示例

2024-09-01 08:32:14
字體:
來源:轉載
供稿:網友
異步刷新想必大家并不陌生吧,本文主要為大家介紹下asp.net jquery+ajax實現異步刷新過程,感興趣的朋友可以參考下

復制代碼 代碼如下:


<!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);
// });//第一種方案,要在text1添加onblur="sys()"事件響應
// }
$(document).ready(function () {
$("#text1").blur(function () {
$.post("test1.ashx", { "Name": $("#text1").val() }, function jy(data) {
$("#text2").val(data);
});
});
});//第二鐘方案
</script>
</head>
<body>
<input type="text" />
轉換
<input type="text" />
</body>
</html>


asph處理程序如下:

復制代碼 代碼如下:


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace 異步刷新
{
/// <summary>
/// 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;
}
}
}
}

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 仙居县| 陇西县| 乌兰察布市| 洞口县| 车险| 饶阳县| 岳普湖县| 海门市| 柘荣县| 松潘县| 安远县| 叙永县| 曲松县| 张掖市| 蓝田县| 留坝县| 望江县| 读书| 钦州市| 金湖县| 清水县| 隆尧县| 惠州市| 教育| 运城市| 桃园县| 珲春市| 得荣县| 涞源县| 蚌埠市| 鸡东县| 江阴市| 长汀县| 建德市| 昌宁县| 房产| 望江县| 文登市| 日喀则市| 新化县| 靖宇县|