Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
|
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 25th, 2007, 06:46 AM
Registered User
 
Join Date: Jan 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to amitnet
Default Asp.net Disable "Back" of window wirh coding

Hi friends,
I m devoloping website for online examination in ASP.net and i want to disabale "Back" option of the window so send me code if you have
 
Old February 13th, 2007, 02:23 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 107
Thanks: 1
Thanked 8 Times in 7 Posts
Default

Technically I don't believe you are allowed to disable the back button in the browser.

Given that you are creating an examination system one solution is to set a session variable counting the questions answered and on page load if they are trying to load a page with a lower number than the previous quiestion (by pressing back) then send them back to the correct page, or an error trapping page, if you want to warn them.

 
Old February 16th, 2007, 05:09 AM
Friend of Wrox
 
Join Date: May 2006
Posts: 107
Thanks: 1
Thanked 8 Times in 7 Posts
Default

Sorry, I forgot to mention that to force the page load you may also need to set the cache expiry

Response.Cache.SetCacheability(HttpCacheability.No Cache)

So that the user then has to press refresh.



 
Old February 19th, 2007, 10:18 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

You can do this with javascript.. there are plenty of exampls online

 
Old March 2nd, 2007, 12:37 AM
Registered User
 
Join Date: Jul 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Use HtmlHIdden control.When you click submit button,in clientside, say Hidden1.value = 1.if Hidden1.value !=1; document.reload.That's all.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Coding scrolling text with VS 2005/ASP.NET cJeffreywang ASP.NET 2.0 Professional 6 August 15th, 2007 07:28 AM
Sending a mail from a flash with asp.net coding waikiat86 ASP.NET 2.0 Basics 3 June 28th, 2007 10:47 PM
How to disable back button of IE? Edward King Javascript 0 November 8th, 2004 02:22 AM
ASP.Net Code Behind & In-Line Coding vinod_pawar1 General .NET 4 October 8th, 2004 02:33 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.