欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

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

程序员文章站 2024-03-08 15:42:22
--前台 复制代码 代码如下: <%@ page language="c#" autoeventwireup="true" codefile="successed.a...
--前台
复制代码 代码如下:

<%@ 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);
}
}