1, 在 Login.aspx 页面 Load 中加入
- if (!IsPostBack && Request.UrlReferrer != null)
- {
- Session[ "url"] = Request.UrlReferrer;
- }
2, 在登录按钮事件中加入
- if (Session["url"] != null)
- {
- Response.Redirect(System.web.HttpUtility.UrlDecode(Session["url"].ToString()));// 重定向到登录前页面
- }
来源: https://www.cnblogs.com/jzzhuhyfu/p/8972991.html