Earlier in this post I mentioned that we can "force" Internet Explorer to forget all history items for page a.aspx when navigating backward from b.aspx by simply adding such code to ButtonClick method:
ScriptManager.RegisterStartupScript(this, GetType(), "hmmm", "", true);
But now I investigated more simple steps to reproduce this horrible IE bug. Add somewhere on
a.aspx <input type="button" onclick="foo()" /> and implement foo() JavaScript function as follows:
var scriptElement = document.createElement('SCRIPT');
document.getElementsByTagName('HEAD')[0].appendChild(scriptElement);
Now it is enough at some moment to click this button to make History control much more useless under IE :( Maybe there is even more simpler script to cause described problem. Above script describes what ScriptManager does when ScriptManager.RegisterStartupScript() is called. You can ensure that document.getElementsByTagName('HEAD')[0].appendChild(document.createElement("SPAN")) also breaks History.