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

Posted tpf386

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了网页自动跳转 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>

 

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

 

以上是关于网页自动跳转 HTTP-EQUIV="REFRESH"的主要内容,如果未能解决你的问题,请参考以下文章

meta http-equiv="refresh" 和13种跳转页面方法

网页实现自动跳转

如何实现用户点击页面的超链接,然后本网页就跳转到A页面。然后再新跳转出一个B页面。求代码

倒计时自动跳转代码问题

html代码 刷新后 网页跳转 不刷新 不跳转

在网页<head>标签之间都会加<meta http-equiv="Content-Type" content="text/html;chars