ASP.NET WebForms: Page data not cleared after redirect when returning with browser Back
11:39 13 Mar 2026

I have an ASP.NET WebForms page where I clear all page data and then redirect the user to another page.

protected void btnNavigate_Click(object sender, EventArgs e)
{
    ClearPageData();
    Response.Redirect("https://example.com/anotherpage");
}

private void ClearPageData()
{
    txtUserName.Text = string.Empty;
    txtNR.Text = string.Empty;
    tbfUser.Text = string.Empty;
    // ... reset other controls and page state
}

Problem:

When the user presses the browser Back button to return to this page, all the previously cleared data reappears. It seems the browser restores the page from its cache or history. Even trying to clear the page in Page_Load doesn’t help, because Page_Load is not executed when returning with Back.

Question:

How can I make sure that when the user goes back to the page after a redirect, the page is actually cleared and does not show old data?

c# asp.net .net webforms aspx-user-control