国产探花免费观看_亚洲丰满少妇自慰呻吟_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;
}
}
}
}

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 定结县| 延川县| 平舆县| 宽城| 和林格尔县| 甘孜县| 揭阳市| 高阳县| 班玛县| 吴桥县| 马鞍山市| 舒城县| 佛坪县| 乐都县| 朔州市| 偏关县| 卓尼县| 历史| 苏尼特右旗| 阿勒泰市| 金门县| 二连浩特市| 吉安县| 奇台县| 措勤县| 尤溪县| 昭平县| 东乡族自治县| 渑池县| 阜新| 安顺市| 九江市| 雷州市| 井研县| 太湖县| 都江堰市| 永泰县| 庐江县| 玉环县| 洞口县| 石门县|