By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,968 Members | 1,681 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,968 IT Pros & Developers. It's quick & easy.

disable back button of IExplorer

P: 30
Respected Sir,
I am currently facing a problem in disabling the back Button of IExplorer.
Actually I have taken two UpdatePanel on the page(Page A).
At first when Page(Page A ) loads then Update Panel 1 Contents is showing it includes Textboxes, Timer and button(Start), On Clicking that Button (Start Button) Update Panel2 loads contains gridview. After this Button(Start ) .visible =false;
Now when Update Panel 2 has been loaded then I want that IExplorer Back Button should be disabled or can'nt go back from this current page state when Update Panel 1 and Update Panel 2 Both loads.
When I am using window.history.forward(1) on Prerender or in <script> Block then Update Panel 2 data have been lost and only Update Panel 1 data has been shown (as displayed when Page A loads first time), therefore i am expecting some help from you , this is really urgent for me. if u have other idea that would be better for me.
I also used window.onbeforunload event and it works good when IExplorer Back Button has been clicked (It alerts to show that there is some unsaved data and when click cancel then page status or remain same ) but when I clicked OK then it will process same as above.
So please help me out.
Nov 25 '09 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 5K+
P: 9,731
Please post new questions in a thread of their own.
I've split your question off: displaying file names aspx page. Since this is not an ASP.NET question I've moved the question to the JavaScript forum.

Disabling the back button is never a good idea.
When the user leaves the page then they may no longer have access to their browser's back button which isn't fair.

Instead of disabling the back button I recommend you add a JavaScript method that handles the window.onbeforeunload event. The onbeforeunload event happens just before the page is unloaded (full page post backs will cause the page to unload). If the method that handles the event returns anything then a message box is displayed asking the user if they want to continue or cancel.

I'm not sure why you are flipping through the user's history..this is a little weird. I would let the user leave the page if they want to leave the page. If they say "yes I want to leave the page" when the onbeforeunload message appears, then you should let them go.

Nov 25 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.