This is a discussion on How to disable back button in .Net? within the ASP and ASP.NET Programming forums, part of the Web Development category; How to disable back button in .Net? For example if you consider this scenario, user gets data which can change ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| How to disable back button in .Net? For example if you consider this scenario, user gets data which can change frequently from database to display it in the screen. From that screen user can go another page where he presses back button of browser to come back to this page again. During that time browser might show the page which is in cache because of which user might not see the approriate data To avoid this you can open the browser without toolbar. So that user won’t see the back button. But in lots of cases we can’t do this. Other way for doing this is, don’t cache the page. So every time any page is requested it will go to the server. Hence user will get the current data. For avoiding page to be cached, you need to set the following properties for response object. Response.Buffer = True Response.ExpiresAbsolute = Now().Subtract(New TimeSpan(1, 0, 0, 0)) Response.Expires = 0 Response.CacheControl = "no-cache" ExpiresAbsolute : Gets or sets the absolute date and time at which to remove cached information from the cache. Expires : Gets or sets the number of minutes before a page cached on a browser expires. If the user returns to the same page before it expires, the cached version is displayed. CacheControl : Sets the Cache-Control HTTP header to Public or Private. Possible values: Public - may be cached in public shared caches Private - may only be cached in private cache no-cache - may not be cached no-store - may be cached but not archived |
| Sponsored Links |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Hide toolbar except the back and next button | saravanan | HTML, CSS and Javascript Coding Techniques | 0 | 03-19-2008 09:35 PM |
| I keep getting "Data Missing" when I click the "back" button in my browser. How can I | oxygen | HTML, CSS and Javascript Coding Techniques | 1 | 07-28-2007 01:12 AM |
| Can I make a button on my page work as the browser's Back button in javascript? | kingmaker | HTML, CSS and Javascript Coding Techniques | 1 | 07-26-2007 01:27 AM |
| How to disable back button on the browser? | Jeyaseelansarc | HTML, CSS and Javascript Coding Techniques | 1 | 05-21-2007 12:44 AM |
| Disable Back Button | ewriter | HTML, CSS and Javascript Coding Techniques | 1 | 04-24-2007 11:16 PM |