我已经调用了一个重定向到另一个页面的方法。完成另一个页面后,我想从上一页回来。这是我的代码:
private string RedirectToPaymentGateway_v3(string MTrackid, string MAmount,string MSType)
{
HttpContext.Current.Session["pgMTrackid"] = MTrackid;
HttpContext.Current.Session["pgMAmount"] = MAmount;
HttpContext.Current.Session["pgMStype"] = MSType;
HttpContext.Current.Response.Redirect("DoPost.asp", true);
return "";
}
完成dopost.asp
后,我想在我调用DoPost.asp
的页面中返回。
答案 0 :(得分:0)
将原始页面作为参数传递,然后重定向到它:
private string RedirectToPaymentGateway_v3(string MTrackid, string MAmount,string MSType)
{
HttpContext.Current.Session["pgMTrackid"] = MTrackid;
HttpContext.Current.Session["pgMAmount"] = MAmount;
HttpContext.Current.Session["pgMStype"] = MSType;
HttpContext.Current.Response.Redirect("DoPost.asp?ReturnUrl=" +
Server.UrlEncode(Request.Url.ToString());
return "";
}
然后在DoPost.asp中处理完
Response.Redirect(Server.UrlDecode(Request.Querystring["ReturnUrl"]));