Hi @Anonymous ,
According to your description,I think,you could session your UrlReferrer. And you only need to check if the session is null.
Page2:
protected void Page1Button_Click(object sender, EventArgs e)
{
Session["url"] = Request.UrlReferrer.AbsoluteUri.ToString();
Response.Redirect("page3.aspx");
}
Page3:
protected void btnBack_Click(object sender, EventArgs e)
{
if (Session["url"].ToString() != null)
{
Response.Redirect(Session["url"].ToString());
}
else
{
......
}
}
Best regards,
Yijing Sun
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.