解决的方法:我们要想办法记录到页面回传的次数N,然后用history.go(-n),就可以回到A页面。
在B页面中放一个控件记录其回传的次数,初始值为1
复制代码 代码如下:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>
在B页面的CS代码如下:
复制代码 代码如下:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.TextBox1.Text = "1";
}
else
{
this.TextBox1.Text = Convert.ToString(Convert.ToInt16(this.TextBox1.Text) + 1);
}
}
这样子不管你从A到了B页面,在B页面中做了什么操作,页面回发了多少次,当你点击【返回】时,都可以跳回页面A了
源码下载



