[Fixed]-"Returning to that page might cause any action you took to be repeated" – Django

34👍

This message is from the browser; and it will display anytime you try to refresh a page that was displayed as the result of a POST request.

It has no bearing on your code, the browser will display the same message on all websites where you try to refresh the page (hit F5 for example) which was displayed as a result of a previous POST request.

To prevent this from happening, make sure all POST requests redirect to a different view upon completion; and not render templates themselves.

2👍

redirect to same page working for me :

header("Location: #");

0👍

Just redirect your page to current page after inserting
, it will clear all the values and avoid adding the Duplicate records !

example:

protected void btnAdd_Click(object sender, EventArgs e)
{
 //your code 
 Response.Redirect("Currentpage.aspx",true);

 //or 
 Response.Redirect(Request.Url.AbsoluteUri);
}

Leave a comment