I’m currently involved in an ASP.NET project where I need to restrict the users ability to go back in the page structure using the back button. It is essentially a wizard style navigation and I don’t want to give the user the ability to go back from the last step and re-submit the data. JavaScript is not an option unfortunately, so I “solved” it by setting the HttpCacheability in every pages Load event to NoCache. This gives the user the “Page expired” page when he or she clicks the back button. It isn’t very elegant at all, and I’m wondering what other options I have to achive the desired results.
Share
Only expose one URL for your entire wizard. The step displayed will depend on session state, which can store what steps they have already completed.
That way there is no “invalid” URL for the user to load.
You should probably consider creating a UserControl for each step. You then place all the steps on a single .aspx page and show and hide them as appropriate.