How to remove returnurl from url?

前端 未结 10 653
梦谈多话
梦谈多话 2020-11-28 08:54

I want to remove \"returnurl=/blabla\" from address bar when a user want to access to a login required page. Because I\'m trying to redirect the user to a static page after

10条回答
  •  独厮守ぢ
    2020-11-28 09:19

    void Application_BeginRequest(object s, EventArgs e)
    {
        // ................
    
        // strip return Return Url
        if (!string.IsNullOrEmpty(Request.QueryString["ReturnUrl"])  && Request.Path.IndexOf("login.aspx")!=-1)
            System.Web.HttpContext.Current.Response.Redirect("~/login.aspx");
    

提交回复
热议问题