码迷,mamicode.com
首页 > Web开发 > 详细

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

时间:2019-11-27 14:57:18      阅读:78      评论:0      收藏:0      [点我收藏+]

标签:demo   vat   new   str   client   bug   自动   https   ntp   

 

文章: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>

 

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

 

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

标签:demo   vat   new   str   client   bug   自动   https   ntp   

原文地址:https://www.cnblogs.com/Tpf386/p/11942271.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!