DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   ASP.NET (http://www.daniweb.com/forums/forum18.html)
-   -   How to disable Back button of IE when executing welcome.aspx page? (http://www.daniweb.com/forums/thread35732.html)

cumadhu Nov 22nd, 2005 12:45 am
How to disable Back button of IE when executing welcome.aspx page?
 
Hi All,
I need to disable Back button of IE when an welcome.aspx page load into the browser.
I dont want the user to click back button after logging in.

Is there any code to disable the back button of IE?

Please send your suggestions.


Thanks and with regards,
Madhusudhan.H.K.

campkev Nov 23rd, 2005 11:51 am
Re: How to disable Back button of IE when executing welcome.aspx page?
 
short answer is No. There is no direct way to disable the back button so that it is greyed-out and user cannot click on it. However, there are some tricks using javascript which might be able to give you the results you need,although they won't be as pretty. One I am currently working on involves using javascripts window.history function with a session variable and automatically logging off and redirecting to login page if user hits the back button. You can also do something as simple as:
<script language="JavaScript">
<!--
  javascript:window.history.forward(1);
//-->
</script>

Put that script at the top of every page. If user hits back button it will send them forward again.

cumadhu Nov 24th, 2005 12:58 am
Re: How to disable Back button of IE when executing welcome.aspx page?
 
Quote:

Originally Posted by campkev
short answer is No. There is no direct way to disable the back button so that it is greyed-out and user cannot click on it. However, there are some tricks using javascript which might be able to give you the results you need,although they won't be as pretty. One I am currently working on involves using javascripts window.history function with a session variable and automatically logging off and redirecting to login page if user hits the back button. You can also do something as simple as:
<script language="JavaScript">
<!--
  javascript:window.history.forward(1);
//-->
</script>

Put that script at the top of every page. If user hits back button it will send them forward again.



Yes ! Its working.
Thanks a lot,
Madhusudhan

sunilfromindia Aug 1st, 2006 11:09 am
Re: How to disable Back button of IE when executing welcome.aspx page?
 
[quote=cumadhu]Hi All,
I need to disable Back button of IE when an welcome.aspx page load into the browser.
I dont want the user to click back button after logging in.

Is there any code to disable the back button of IE?


where should I place the java script

sunilfromindia Aug 1st, 2006 11:10 am
Re: How to disable Back button of IE when executing welcome.aspx page?
 
Hi where should I place javascript

campkev Aug 1st, 2006 2:02 pm
Re: How to disable Back button of IE when executing welcome.aspx page?
 
just like it says, at the top of every page

tgreer Aug 1st, 2006 3:16 pm
Re: How to disable Back button of IE when executing welcome.aspx page?
 
There is no way to disable the back button reliably. Every method, short of writing your own browser, can be easily disabled. This question has been asked millions of times, for years and years. The "back" button is integral to how browsers work, and is firmly a part of the user interface and the collective "user expectation". Trying to fight it is usually a sign of poor understanding of the web, a flawed application model , and/or bad design!

Users will press the "back" button. They will be irritated if it doesn't work. They will often simply close the browser completely if your application doesn't behave as they expect.

prst123 Dec 29th, 2006 3:26 am
Re: How to disable Back button of IE when executing welcome.aspx page?
 
you cant disable only the back button
but u can sure hide the status bar (which includes several other buttons like refresh, forward etc )

nikkiH Dec 29th, 2006 10:26 am
Re: How to disable Back button of IE when executing welcome.aspx page?
 
Which can be gotten back again with one click.

Make a decent application instead; save yourself work and your users hassle.

rbeasley Sep 9th, 2007 11:40 pm
Re: How to disable Back button of IE when executing welcome.aspx page?
 
Quote:

Originally Posted by tgreer (Post 239308)
There is no way to disable the back button reliably. Every method, short of writing your own browser, can be easily disabled. This question has been asked millions of times, for years and years. The "back" button is integral to how browsers work, and is firmly a part of the user interface and the collective "user expectation". Trying to fight it is usually a sign of poor understanding of the web, a flawed application model , and/or bad design!

Users will press the "back" button. They will be irritated if it doesn't work. They will often simply close the browser completely if your application doesn't behave as they expect.

*****

I am sometimes amazed at the arrogance of some software developers who think that, of the 6+ billion people on the earth, no one could possible have a need to disable the back button. We just are stupid and don't understand the problem. Well, he's wrong. Hint: Just help people with their questions and don't be a smart @.

campkev Sep 10th, 2007 12:38 am
Re: How to disable Back button of IE when executing welcome.aspx page?
 
Quote:

Originally Posted by rbeasley (Post 431409)
*****

I am sometimes amazed at the arrogance of some software developers who think that, of the 6+ billion people on the earth, no one could possible have a need to disable the back button. We just are stupid and don't understand the problem. Well, he's wrong. Hint: Just help people with their questions and don't be a smart @.


I am no longer amazed by newbie posters who tell people that have consistently been on this (or any) forum for a long time helping people how to help people. Sometimes, the best way to help someone is to NOT answer the question they asked but answer the question they did not ask. No doctor would just give instructions on how to put your leg in a splint if someone said "Hey, I broke my femur, but I think I'll just tough it out. How should I splint it?" They would tell the person to go to the hospital and be seen by a doctor.

sandeep.mk Sep 11th, 2007 7:56 am
Re: How to disable Back button of IE when executing welcome.aspx page?
 
Boss,

it is ok for single window,
how about a jsp which contains 3 frames.

can u do for a jsp page which conatins 3 frames.

regards
sandeep.

dnanetwork Jun 2nd, 2009 2:28 pm
Re: How to disable Back button of IE when executing welcome.aspx page?
 
hello people it works fine with IE 6 but suks at IE 7 & IE 8.

dnanetwork Jun 27th, 2009 9:35 am
Re: How to disable Back button of IE when executing welcome.aspx page?
 
all above suggestions will not work in IE7 or Mozilla...

it works fine with IE6...

Ajax can help...

vibinvarghese Oct 7th, 2009 1:17 pm
This works fine...
 
<script language="javascript" >

history.forward();

</script>

arif_manit Oct 23rd, 2009 1:04 am
Write a javaScript
<script Type="text/javascript" language="javascript">
history.forward(1);
</script>
into the head of the page


All times are GMT -4. The time now is 1:18 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC