当前位置: 首页 > 图文教程 > 网络编程 > ASP.NET > asp.net 页面延时五秒,跳转到另外的页面

ASP.NET
妙用Cache检验用户是否重复登陆
ASP.NET 2.0–善用DataSourceMode属性
在ASP.NET AJAX中别使用mode="Legacy"
探讨ASP.NET 2.0的Web控件改进之概述
asp.net创建文件夹的IO类的问题
asp.net 实现购物车详细代码
ASP.NET2.0+SQL Server2005构建多层应用
用ICallbackEventHandler实现客户端与服务器端异步
ASP.NET页面的重定向
抢先试用ASP.NET 2.0中的新型安全控件
ASP.NET中Cookie编程的基础知识
Asp.net导航控件真的值得用吗?
ASP.NET中上传文件到数据库
cs及前身asp.net forums的调试
ASP.NET2.0 遍历文件夹下所有图片
用ASP.NET创建自定义文本框
ASP.NET中设计带事件定制控件
ASP.NET+ORACLE添加记录让ID自动增量
C#+ASP.NET开发基于Web的RSS阅读器
ASP.NET2.0导航功能之配置会员和角色

ASP.NET 中的 asp.net 页面延时五秒,跳转到另外的页面


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2010-01-10   浏览: 74 ::
收藏到网摘: n/a

asp.net 页面延时五秒,跳转到另外的页面的实现代码。 --前台
复制代码 代码如下:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Successed.aspx.cs" Inherits="Biz_Order_Successed" %>
<!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 runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div style="height: 100px">
</div>
<div align="center">
<asp:Label ID="lbmessage" runat="server" Font-Size="Large" Font-Bold="true"></asp:Label>
<br />
<br />
<font size="4" >
系统将会在五秒钟后转向浏览页面
</font>
<br />
<br />
<font color="blue" size="4" ><a id="hrefUrl" href="" style="text-decoration: underline" runat="server"></a></font>
</div>
</form>
</body>
</html>

--后台
复制代码 代码如下:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HyiSoft.WebUtility;
public partial class Biz_Order_Successed : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string message = string.Empty;
string url = string.Empty;
url = Utility.Request("url");
message = Utility.Request("message");
lbmessage.Text = message;
hrefUrl.HRef = url;
hrefUrl.InnerText = "手动转向页面";
string strRedirectPage = url;
string strRedirectTime = "5";
string strRedirect = string.Format("{0};url={1}", strRedirectTime, strRedirectPage);
Response.AddHeader("refresh", strRedirect);
}
}