All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
c#中连接SqL2005数据库错误解决及转义字符_.net资料_编程技术
。Net开发环境配置
在ASP.NET2.0中的WEB.CONFIG文件中调用外部文件_[Asp.Net教程]
delphi画笔类(TPen)使用方法
利用C#创建,IIS,站点并设置.NET,Framework版本为ASP.NET,2.0,的方法,一_[Asp.Net教程]
[SQL,Server数据库的连接处理解决方案_[SQL,Server教程]
分页显示详解_[PHP教程]
入门知识:动态网页PHP编程中字符串5个技巧_php资料_编程技术
ajax+php无刷新二级联动下拉菜单(省市联动)源码_[PHP教程]
使用ASP.NET,Atlas开发检测密码强度的自定义Behavior_[Asp.Net教程]
Reading number is top 10 pictures
这只猪到底犯了什么错?
Ashlynn Brooke a group sexy photo1
西方气质的东方美女3
9.3阅兵全景图7-指挥系统和后勤保障系统梯队
妹子最好别玩单反
俄罗斯台球天后惊艳魅惑2
Fender Bender that so horrifying1
Ashlynn Brooke photograph of a group3
From China fortress sora aoi2
传几朵花
Download software ranking
Sora aoi - one of more PK
Professional killers2 data package
电车之狼R
Jinling thirteen stock
Tram sex maniac 2 (H) rar bag8
尖东毒玫瑰B
Boxer's Top ten classic battle9
电脑知识及技巧大合集
Unix video tutorial11
Love the forty days
aaa published in(发表于) 2013/12/17 7:46:28 Edit(编辑)
一个无刷新效果定时自动更新页面的例子_.net资料_编程技术

一个无刷新效果定时自动更新页面的例子_.net资料_编程技术

一个无刷新效果定时自动更新页面的例子_.net资料_编程技术-你的首页-uuhomepage.com







  一个无刷新效果定时自动更新页面的例子(ASP.NET2.0-应用xmlhttp)




  首先在ASP.Net创建两个WebForm页,分别命名为Default1,Default2。下面给出代码清单:




//Default1.aspx




<%@ Page Language="C#" Debug="true" AutoEventWireup="true" CodeFile="Default1.aspx.cs" Inherits="Default1" %>
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
http://www.w3.org/1999/xhtml" >

无标题页




Ajax Dynamic Update Example


This page will automatically update itself:


Page will refresh in 1 seconds.




























//Default2.cs




using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class Default2: System.Web.UI.Page
{
private static int counter = 1;
protected void Page_Load(object sender, EventArgs e)
{
String res = "";
String task = this.Request.Params["task"];
String message = "";
if (!string.IsNullOrEmpty(task))
{
if (task.Equals("reset"))
{
counter = 1;
}
else
{
switch (counter)
{
case 1: message = "Steve walks on stage"; break;
case 2: message = "iPods rock"; break;
case 3: message = "Steve says Macs rule"; break;
case 4: message = "Change is coming"; break;
case 5: message = "Yes, OS X runs on Intel - has for years"; break;
case 6: message = "Macs will soon have Intel chips"; break;
case 7: message = "done"; break;
}
counter++;
}
res = "" + message + "";
Response.ContentType = "text/Xml";
Response.AppendHeader("Cache-Control", "no-cache");
Response.Write("");
Response.Write(res);
Response.Write("
");
Response.End();
}
}
}






















添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.