Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IE Disable Buttons Through ASP

Status
Not open for further replies.

bjr149

Programmer
Jul 18, 2005
26
US
Can you disable the back button on the internet explorer bar for a session through asp code?
 
I noticed he said he liked this idea. "client-side JavaScript code to open a new window that doesn't have the toolbar."

I'd like to give this option a shot. How do i remove the toolbar for a new opened window?
 
also i just want the buttons not to be there. I want to see the address bar and the regular file menu bar.
 
<SCRIPT>
function newwindow(theUrl) {
window.open(theUrl, 'jav', 'width=640,height=320,resizable=no,scrollbars=auto');
}
</SCRIPT>

<a href="newpage.asp" onclick="newwindow(this.href);return false;">Click here to open a window with no toolbar</a>
 
So what exactly is to stop the user from just pressing the backspace button, or alt+left key, or right clicking and selecting "back" from the context menu, etc, etc, etc

-kaht

[small]How spicy would you like your chang sauce? Oh man... I have no idea what's goin' on right now...[/small]
[banghead]
 
You can disable the context menu with the following:

<body onContextMenu="return false">

Not sure about the other ones - I think instead of concentrating on stopping the user going back you should look at what to do IF the user goes back.

This is all covered in the article I gave you the link for.

cheers
 
Sorry, but I can't help myself... It's that kind of a day...
kaht said:
So what exactly is to stop the user from just pressing the backspace button, or alt+left key, or right clicking and selecting "back" from the context menu, etc, etc, etc
<sarcasm> Users who don't know any better? </sarcasm>
[lol]

------------------------------------------------------------------------------------------------------------------------
"Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."
- Winston Churchill
 
Or depending on WHY you need to stop them from going back there are a number of other approaches.
For instance, if the previous page was a form and you do not want the form content available if they hit the back button you can set an onload event that clears the form as the page loads or you pass the submitted values via AJAX, get a return response from that processing page and then clear the current form and redirect the page to wherever you need it to be.

The possibilites vary based on what you are actually trying to prevent occuring and why.
If popping open a new window without navigation bars is enough for you then problem solved but there may be better methods depending on exactly why/what you want to accomplish.


It's hard to think outside the box when I'm trapped in a cubicle.
 
The reason why i need to disable the back button is because it screws up the application were running. All the navigation is supposed to be done within the UI screens. The problem is sometimes users accidentally hit the IE back button and it messes up their current session. Then they have to re-login and stuff like that.



 
Thats generally a design problem. Personally I cannot stand sites that require you to not use your back button because I have been using the back button for over a decade and it makes sense when I want to return to the previous page that I would use the back button.
I apologize if this doesn't answer your question, but I feel it is an important point. Useability is generally the biggest reason I have for not visiting or using certain websites.

For instance, we use Sterling Commerce for EDI transactions to various customers. I can login to their portal and look at tracking informaiton for any document that came in or went out. This is important when troubleshooting. However, they absolutely require you to naviagte the site through their own buttons. The site does nothing terribly complicated, but the second you click a document, realize it isn't the right one, hit the back button...your dumped back to the login page with an error message.
This is a huge useability issue from my point of view. If this was there primary service (viewing transactions rather than handling them with the option to view) then I would pick a differant company to do business with. I should not have to retrain years of common practice and habit simply to use a web-based service, and I'm sure many other people feel the same.

-T

barcode_1.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top