Browser "Back" reloads current page instead of going back

Cjames
Cjames used Ask the Experts™
on
We have a pair of aspx pages -- page "a" has a repeater with imagebuttons built on databinding.  When the user clicks on one of those buttons, the ItemCommand event populates a session variable with the desired URL, and the loads page "b".  Page "b" contains a header and an iframe.  The iframe uses the session var to determine its contents.  

Problem #1 -- when the user went back and picked another URL, it reloaded the same iframe contents as the first time.  I tried session.clear, I tried the no-cache... nothing worked to fix that problem reliably until I added a random querystring...

Fixing #1 seems to have caused #2 -- the random works great, until someone uses the browser's "back" button instead of our custom one... That is now reloads page "b" instead of "a'.  

How do I get page "b"s  browser "back" button to reload page "a"?

Thanks!
Page "a" ItemCommand snip:

HiddenField BusName = (HiddenField)e.Item.FindControl("BusinessName");
                    Session["ActiveBusName"] = BusName.Value;
                    HiddenField BusLink = (HiddenField)e.Item.FindControl("HomeMe");
                    cmdMe = BusLink.Value;
 Session["ActiveBus"] = cmdMe;
string s = "CategoryItem.aspx?CatID=" + Session["CatID"].ToString() + "&Category=" + Session["Category"].ToString() +"&ADTl=" + DateTime.Now.ToString("yyyyMMddHHmmss"); 
                        Response.Write("<script>window.open('" + s + "','_self')</script>");


Page "b" iframe:
<iframe name="ifrm" width="100%" scrolling="auto" id="ifrm" src=<% Response.Write(Session["ActiveBus"].ToString()); %> frameborder="0" height="0">Your browser does not support iframes.</iframe>

Page "b" imagebutton code to return to correct page
string s = "CategoryListing.aspx?CatID=" + Session["CatID"].ToString() + "&Category=" + Session["Category"].ToString();
            Response.Write("<script>window.open('" + s + "','_self','resizable=yes,location=no,directories=no,menubar=no,scrollbars=no,status=no,toolbar=no,titlebar=no')</script>");

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
seems like the page is loaded after a redirect
do you experiance the same behaviour if you go back 2 instead of one page?
IT Expert
Top Expert 2009
Commented:
Hard to guess, can you try to change
window.open('" + s + "','_self')
to
location.replace(s);

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial