title: Thread was being aborted. For response.redirect. how to redirect when session is Null in following code
body: <p>how to redirect when session is Null in following code .   Thread was being aborted is the exception i am facing </p>
  
  <pre><code>    protected async void Page_Load(object sender, EventArgs e)
      {
          try
          {
              if (Session["mail"] == null)
              {
                  Response.Redirect("login.aspx", true);
                  Context.ApplicationInstance.CompleteRequest();
              }
          }
          catch (ThreadAbortException r)
          {
  
              Response.End();
          }
  
          await Task.Run(() =&gt; retrivelast());
    }
  </code></pre>