473,403 Members | 2,222 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

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 3886
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.worldnet.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=onbeforeunload language=javascript>
if(!YourValidation)
event.returnValue="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.worldnet.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
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...
5
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
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...
5
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
by: shajuk | last post by:
I want the source code in javascript to disable browsers back & forward button
6
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...
3
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
by: gopim | last post by:
how to disable browser back button after clickng signout button
3
by: vingomail | last post by:
How to disable our browser back button? help me please
1
Jogendra Singh
by: Jogendra Singh | last post by:
How we can Disable browser save as Button ?????? Plz help me ???????/
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.