AJAX 无刷新
ICallbackEventHandler
aspx 页面:
function CallServer(PhotoId)
{
document.getElementById("updatediv").style.display = "block";
document.getElementById("txtPhotoID").value = PhotoId;
var product = document.all("txtPhotoID").value;
<%= ClientScript.GetCallbackEventReference(this, "product", "ReceiveServerData",null)%>;
}
function ReceiveServerData(PhotoInfo)
{
if(PhotoInfo!="")
{
var result="";
var str=PhotoInfo;
var Photo=str.split("^&^");
for(i=0;i<Photo.length;i++)
{
result += Photo[i];
}
document.getElementById("txtPhotoName").value=Photo[0];
document.getElementById("txtPhotoDescr").value=Photo[1];
}else{("请选择需要修改的相片!");}
}
.cs 页面
string ICallbackEventHandler.GetCallbackResult()
{
return Server.UrlDecode(CallBackValue)+"^&^"+Server.UrlDecode(CallPhotoColltion);
}
void ICallbackEventHandler.RaiseCallbackEvent(string eventArgument)
{
int PhotoID = int.Parse(eventArgument);
PhotoInfo = Photo.GetModel(PhotoID);
string PhotoName = PhotoInfo.PhotoName;
CallBackValue = Server.UrlDecode(PhotoName);
string PhotoIntroduction = PhotoInfo.PhotoIntroduction;
CallPhotoColltion = Server.UrlDecode(Phot
相关文档:
简单的描述下 DWR 配置(保密协议,在此不公开项目名称,项目相关名称全部用XXXX代替)
首先 废话不说了 大家都应该理解DWR的用处 不懂的去百度
必要包 DWR.JAR 官方下载地址http://directwebremoting.org/dwr/download.html
这个项目是由 SSH+dwr+jquery+sitemesh+freemarker
WEB.XML
<!-- dwr -->
<serv ......
从2005 年Web2.0 的兴起开始算起,Ajax 伴随着国内的Web 开发社区走过了近四年的成长时间。四年的时间,对于一项Web 技术不算短了,这不仅是对当初对Ajax“旧瓶装新酒”持不屑态度的人的反驳,更把更多观望中的开发者拉入了Web 开发的行列。
Ajax的框架也开始一一出现:
Buffalo 是现任Thought ......
AjaxSuggest.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AjaxSuggest.aspx.cs" Inherits="AjaxSuggest" %>
<!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/199 ......
为了让各为能够了解什么是AJAX,以下是一个AJAX的手工范例(即不引用任何的Library或AJAX
framework),此范例颇为精要易懂,其作用主要是透过Client 端的Browser来即时监控Web 服务器资源或效能变化,各位只要做过
一遍范例就能够了解AJAX在网页开发上是多么具有威力了。
先来看看效果图:
本范例是一个简单的A ......
php代码:
<?php
$arr = array(1, '刘天才', 22);\
echo json_encode($arr);die();
?>
js:
<script type="text/javascript">
function returnObj( info )
{
var string = info.responseText;
var array = eval( ......