Back button and .Net


I have a good question here and I need some help. No idea if this is possible.

Imagine this scenario: you go from a web page A to a page B by a click.
OK. now I have on the page B some buttons to trigger some decorations changes on the page B, like having the text in three columns, the font size, etc...

But of course, because of the server-side effect, the history include these changes.

So now this is the challenge. How can I use the Back button of the browser and back automatically to the A page and not to the cache version of the modified page B.

I can't think about disable viewstate because I need it to maintain some infos on the page.
Maybe the cache ?!?

My two cents on that will be probably to use the Javascript function History(), but not totally sure about that.
I am sure that this is a task a lot of people would like to be solve.

Any idea?

7 Comments

  • Hey Paschal- what happened to using the asp list serves for this stuff? I never see you there anymore.

  • Yeah you right Julie, just didn't think about it ;-))

  • Pascal - when I get home today I'll post an extensive rant on this, and some thoughts on how you can work around it. We've dealt with this a lot in the past.





    While you're at it.... try using the refresh button on any postback :)

  • You can create a server side history object and add new entries when !IsPostBack && url != lastUrl, you can use this info to implement your own back functionality. Still, I don't know if you can hook into the back button with JS (or if you would want to, because you need to post back when the user clicks the back button to adjust the cursor in the history).

  • There is a simple fix for IE 5 and up. In your Page Directive, include SmartNavigation="true". This will eliminate the postbacks from your browser history and also the Retry/Cancel dialog that a Refresh action triggers as Tim mentioned.

  • How do I install my back button?

  • Well U can use javascript to control it though i'm still looking for the solution

Comments have been disabled for this content.