use this , it will work fine for all case
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
StringBuilder javaScript = new StringBuilder();
javaScript.Append("
<script language=JavaScript>
");
javaScript.Append("window.history.forward(1);
");
javaScript.Append("</script>
");
Page.RegisterClientScriptBlock("HistoryScript", javaScript.ToString());
}