473,779 Members | 2,016 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Disable the X in the Browser

How do I disable the "X" in the upper right hand corner of my Web Page.
This is not for a windows form, but rather a web application. What I really
need is to stop the user from unloading the page, if certain data is not
present on the page. I know I should not use the Page_Unload event for
this. I wouild like to disable the Close Button, or putting some extra
validation behind a certain event, which event I am not sure. Any help
would be appreciated?


Nov 17 '05 #1
2 3900
Forget about disabling the user to close the browser, it's not going to
happen. But if you tell us why would you want to do that we might be able to
offer you some solutions.

Jerry

"Mike Nooney" <ju***@worldnet .att.net> wrote in message
news:oN******** **************@ bgtnsc05-news.ops.worldn et.att.net...
How do I disable the "X" in the upper right hand corner of my Web Page.
This is not for a windows form, but rather a web application. What I really need is to stop the user from unloading the page, if certain data is not
present on the page. I know I should not use the Page_Unload event for
this. I wouild like to disable the Close Button, or putting some extra
validation behind a certain event, which event I am not sure. Any help
would be appreciated?

Nov 17 '05 #2
You can't disable the X button without making the page fullscreen, and even
then they can alt+F4 or ctrl+W the page.
You can't keep them from closing the page, but you can warn them with a
client script

<script for=window event=onbeforeu nload language=javasc ript>
if(!YourValidat ion)
event.returnVal ue="Your Warning";
</script>

This will pop up a dialog warning them they are navigating away from the
page because of some reason, but you can't keep them from closing a page.
"Mike Nooney" <ju***@worldnet .att.net> wrote in message
news:oN******** **************@ bgtnsc05-news.ops.worldn et.att.net...
How do I disable the "X" in the upper right hand corner of my Web Page.
This is not for a windows form, but rather a web application. What I really need is to stop the user from unloading the page, if certain data is not
present on the page. I know I should not use the Page_Unload event for
this. I wouild like to disable the Close Button, or putting some extra
validation behind a certain event, which event I am not sure. Any help
would be appreciated?

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1739
by: Erwin Moller | last post by:
Hi, Does anybody know if it is possible to suggest to the browser to NOT offer 'remember values' in forms on a page? And if so: how? ;-) I have this situation where a page has a lot of buttons that fire some events, and also sometimes submitting a form. The pop-up is quite annoying.
5
5040
by: Stefan Mueller | last post by:
Today I'm using <html> <head> <meta http-equiv = "pragma" content = "no-cache"> </head> This prevent the browser to cache the page. So each time I call the following PHP script <?php
2
2927
by: sent85 | last post by:
My issue is when I try to increase or decrease the text size of my page by navigating through “View - > Text Size -> Increase /Decrease” it will change the entire page content. But my requirement is like even though I try to do the “View - > Text Size -> Increase /Decrease” operation in either Firefox or IE. My page should not get disturb, No change should occur in my page. I am following W3 STANDARDS, so that I am using only 'div', not...
5
2360
by: Blackmore | last post by:
I would like to protect the content of my web-site pages. Does anyone know how to disable the 'File->Save As' command on a web-browser.
3
1907
by: shajuk | last post by:
I want the source code in javascript to disable browsers back & forward button
6
29630
by: sspost | last post by:
how can i disable the back button for a browser? I have been reading a lot of forums but cant find any answer to it...other than opening up the page, in which i want to disable the browser in a new window(which i dont want to do) Is their a way to do it? using javascript or something? I have tried using the following but non of them actually disable the back button: window.history.forward(1); -- does not disable the back button
3
2611
by: handumom | last post by:
is it possible to diseble the close button in pop up?what is the code in asp.net using vb
1
1301
by: gopim | last post by:
how to disable browser back button after clickng signout button
3
1215
by: vingomail | last post by:
How to disable our browser back button? help me please
1
1900
Jogendra Singh
by: Jogendra Singh | last post by:
How we can Disable browser save as Button ?????? Plz help me ???????/
0
9474
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10306
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10138
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10074
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9930
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8961
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5503
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2869
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.