时加载页面刷新每次 [英] the page is refreshed every time when is loaded
本文介绍了时加载页面刷新每次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个aspx页面中得到URL的值。
I have an aspx page the get a value from url .
页面的code是这样的:
the page's code is like this :
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="confirmpayment.aspx.cs" Inherits="AccidentCongress.UserPortal.confirmpayment" %>
<div id="bankform"></div>
<script language="javascript" type="text/javascript">
function postRefId(refIdValue) {
var form = document.createElement("form");
form.setAttribute("method", "POST");
form.setAttribute("action", "<% System.Configuration.ConfigurationManager.AppSettings["PgwSite"].ToString(); %>");
form.setAttribute("target", "_self");
var hiddenField = document.createElement("input");
hiddenField.setAttribute("name", "RefId");
hiddenField.setAttribute("value", refIdValue);
form.appendChild(hiddenField); document.getElementById("bankform").appendChild(form);
form.submit();
document.getElementById("bankform").removeChild(form);
}
</script>
<%
if (Request.QueryString["po"] == "true")
{
Response.Write("<script language='javascript' type='text/javascript'> postRefId('" + Request.QueryString["rid"] + "');</script>");
}
%>
但是,当我把这个页面的页面被刷新,每次执行code的这一部分:
But when i call this page the page is refreshed ,and this part of code is executed every time :
<%
if (Request.QueryString["po"] == "true")
{
Response.Write("<script language='javascript' type='text/javascript'> postRefId('" + Request.QueryString["rid"] + "');</script>");
}
%>
为什么?
最好的问候
推荐答案
您
form.submit();
在您的JavaScript函数调用
in your javascript function call
这篇关于时加载页面刷新每次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文