网页自动跳转 HTTP-EQUIV="REFRESH"

 

文章:META HTTP-EQUIV="REFRESH" 实现网页自动跳转

< META HTTP-EQUIV="REFRESH" CONTENT="x; URL=*.*"> 

 <meta http-equiv="refresh" content="0; url='<%= tMerchantPage %>'">

 

复制代码
<%@ Page Language="C#" Debug="true" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

    private string tMerchantPage = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        //1、取得MSG参数,并利用此参数值生成支付结果对象
        com.abc.trustpay.client.ebus.PaymentResult tResult = new com.abc.trustpay.client.ebus.PaymentResult();
        tResult.init(Request["MSG"]);

        //2、判断支付结果状态,进行后续操作
        if (tResult.isSuccess())
        {
            //3、支付成功
            //tMerchantPage = "http://172.30.7.117/demo/CustomerPage.aspx?请传入必要的参数"  如下:
            tMerchantPage = "http://172.30.7.117/demo/CustomerPage.aspx?OrderNo=" + tResult.getValue("OrderNo");
        }
        else
        {
            //4、支付失败
            //tMerchantPage = "http://172.30.7.117/demo/MerchantFailure.aspx?请传入必要的参数" 如下:
            tMerchantPage = "http://172.30.7.117/demo/MerchantFailure.aspx?OrderNo=" + tResult.getValue("OrderNo");
        }
    }
</script>

<!--
<URL><%= tMerchantPage %></URL>
-->
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <meta http-equiv="refresh" content="0; url='<%= tMerchantPage %>'">
</head>
</html>
复制代码

 

在农行支付中看到的代码,之前没见过这种跳转页面的方式。

 

posted on   荆棘人  阅读(749)  评论(0编辑  收藏  举报

编辑推荐:
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
历史上的今天:
2018-11-27 es6-学习
2018-11-27 javascript修改div大小遮挡页面渲染问题
2018-11-27 报表功能设计思考-初步尝试-第一次
2018-11-27 导出统计数据-经验积累-深入1
2017-11-27 socket一个例子
2017-11-27 SQLite
2017-11-27 asp.net 页面缓存、数据缓存

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示