Community discussion forum
DISABLING/HIDING THE CLOSE BUTTON!?
-
Right now i m working in ASP.NET with C# (.net 2003, 1.1 framework).
i need to disable/hide the close button which is in the right top corner of the page (in IE). OR... i would like to hide the whole bar including the minimize,maximize and close button..... how to achieve it?
Thanks in advance........... KARAN.
-
Hi karan_21584 ,
you cant disable the close button in the browser for security reasons. What you can do is to open the window in fullscreen size, in this way, the browser automatically will hide the titlebar and the minimize, maximize, and close buttons.You should use following code -
<body MS_POSITIONING="GridLayout" onload="OpenForm()">
and the javascript function is -
function OpenForm()
{
window.open('index.aspx','fullscreen=yes,titlebar=no,toolbar=no,statusbar=no');
}
Hope this will help you.
Thanks & Regards
Dilipv -
so there is no any other way to restrict the user to make un-use of close button?????? and ALT+F4??? acutally i want to execute a set of code (function) when the IE closes.. how to achieve it?
-
Hi,
You can execute code using the onunload event of the body element.
In here you can do any cleanup necessary on cookies etc.
Si
-
thanks Slicksim. may i know how to achieve it?
-
Why do you want to disable the close button on the browser? Also what type of code are you wanting to run on page unload? The reason I ask is that there are bad people out there that wants to do bad thing.
-
actually i m doing a project where the ID field is auto generated(through my program, and this ID is string datatype) one. more than 1000 users attacks the database. so ID repeatation may occur.so what i do is, when ID auto generated it store to the database and after user enters all datas in textbox,drop down box etc, they will click SAVE button where through means of that ID, all data will be updated. if user press EXIT button, then if ID box is filled with some ID it should delete that particular value from database. THIS is MY OVERALL PROCESS. but if user click the CLOSE BUTTON in IE, then problem will occur and i cant process through means of EXIT button coding.RIGHT?.....
-
actually i m doing a project where the ID field is auto generated(through my program, and this ID is string datatype) one. more than 1000 users attacks the database. so ID repeatation may occur.so what i do is, when ID auto generated it store to the database and after user enters all datas in textbox,drop down box etc, they will click SAVE button where through means of that ID, all data will be updated. if user press EXIT button, then if ID box is filled with some ID it should delete that particular value from database. THIS is MY OVERALL PROCESS. but if user click the CLOSE BUTTON in IE, then problem will occur and i cant process through means of EXIT button coding.RIGHT?.....
For t
-
actually i m doing a project where the ID field is auto generated(through my program, and this ID is string datatype) one. more than 1000 users attacks the database. so ID repeatation may occur.so what i do is, when ID auto generated it store to the database and after user enters all datas in textbox,drop down box etc, they will click SAVE button where through means of that ID, all data will be updated. if user press EXIT button, then if ID box is filled with some ID it should delete that particular value from database. THIS is MY OVERALL PROCESS. but if user click the CLOSE BUTTON in IE, then problem will occur and i cant process through means of EXIT button coding.RIGHT?.....
For this only i
-
actually i m doing a project where the ID field is auto generated(through my program, and this ID is string datatype) one. more than 1000 users attacks the database. so ID repeatation may occur.so what i do is, when ID auto generated it store to the database and after user enters all datas in textbox,drop down box etc, they will click SAVE button where through means of that ID, all data will be updated. if user press EXIT button, then if ID box is filled with some ID it should delete that particular value from database. THIS is MY OVERALL PROCESS. but if user click the CLOSE BUTTON in IE, then problem will occur and i cant process through means of EXIT button coding.RIGHT?.....
For t
his -
actually i m doing a project where the ID field is auto generated(through my program, and this ID is string datatype) one. more than 1000 users attacks the database. so ID repeatation may occur.so what i do is, when ID auto generated it store to the database and after user enters all datas in textbox,drop down box etc, they will click SAVE button where through means of that ID, all data will be updated. if user press EXIT button, then if ID box is filled with some ID it should delete that particular value from database. THIS is MY OVERALL PROCESS. but if user click the CLOSE BUTTON in IE, then problem will occur and i cant process through means of EXIT button coding.RIGHT?.....
FOr
-
actually i m doing a project where the ID field is auto generated(through my program, and this ID is string datatype) one. more than 1000 users attacks the database. so ID repeatation may occur.so what i do is, when ID auto generated it store to the database and after user enters all datas in textbox,drop down box etc, they will click SAVE button where through means of that ID, all data will be updated. if user press EXIT button, then if ID box is filled with some ID it should delete that particular value from database. THIS is MY OVERALL PROCESS. but if user click the CLOSE BUTTON in IE, then problem will occur and i cant process through means of EXIT button coding.RIGHT?.....
For this only i
m -
actually i m doing a project where the ID field is auto generated(through my program, and this ID is string datatype) one. more than 1000 users attacks the database. so ID repeatation may occur.so what i do is, when ID auto generated it store to the database and after user enters all datas in textbox,drop down box etc, they will click SAVE button where through means of that ID, all data will be updated. if user press EXIT button, then if ID box is filled with some ID it should delete that particular value from database. THIS is MY OVERALL PROCESS. but if user click the CLOSE BUTTON in IE, then problem will occur and i cant process through means of EXIT button coding.RIGHT?.....
For this only i
-
actually i m doing a project where the ID field is auto generated(through my program, and this ID is string datatype) one. more than 1000 users attacks the database. so ID repeatation may occur.so what i do is, when ID auto generated it store to the database and after user enters all datas in textbox,drop down box etc, they will click SAVE button where through means of that ID, all data will be updated. if user press EXIT button, then if ID box is filled with some ID it should delete that particular value from database. THIS is MY OVERALL PROCESS. but if user click the CLOSE BUTTON in IE, then problem will occur and i cant process through means of EXIT button coding.RIGHT?.....
For this only i m asking DISABLING / HIDING close button in IE..
-
actually i m doing a project where the ID field is auto generated(through my program, and this ID is string datatype) one. more than 1000 users attacks the database. so ID repeatation may occur.so what i do is, when ID auto generated it store to the database and after user enters all datas in textbox,drop down box etc, they will click SAVE button where through means of that ID, all data will be updated. if user press EXIT button, then if ID box is filled with some ID it should delete that particular value from database. THIS is MY OVERALL PROCESS. but if user click the CLOSE BUTTON in IE, then problem will occur and i cant process through means of EXIT button coding.RIGHT?.....
For this o
-
actually i m doing a project where the ID field is auto generated(through my program, and this ID is string datatype) one. more than 1000 users attacks the database. so ID repeatation may occur.so what i do is, when ID auto generated it store to the database and after user enters all datas in textbox,drop down box etc, they will click SAVE button where through means of that ID, all data will be updated. if user press EXIT button, then if ID box is filled with some ID it should delete that particular value from database. THIS is MY OVERALL PROCESS. but if user click the CLOSE BUTTON in IE, then problem will occur and i cant process through means of EXIT button coding.RIGHT?.....
For this only i
-
actually i m doing a project where the ID field is auto generated(through my program, and this ID is string datatype) one. more than 1000 users attacks the database. so ID repeatation may occur.so what i do is, when ID auto generated it store to the database and after user enters all datas in textbox,drop down box etc, they will click SAVE button where through means of that ID, all data will be updated. if user press EXIT button, then if ID box is filled with some ID it should delete that particular value from database. THIS is MY OVERALL PROCESS. but if user click the CLOSE BUTTON in IE, then problem will occur and i cant process through means of EXIT button coding.RIGHT?.....
For this only i
-
Thanks I had to ask, there are some sick coders out there. Anyway like someothers have said asp.net is server side code, so inorder to tell when someone moves away from your site or closes the browser you will have to use javascript. With asp.net the best way to connect javascript to asp.net code is with ajax. You are running 1.1 so here is a tutorial on using ajax with asp.net 1.1. http://www.ajaxprojects.com/ajax/tutorialdetails.php?itemid=12
Next here is an Article on 4Guys the onbeforeunload event. http://www.4guysfromrolla.com/webtech/100604-1.shtml
You may also want to do a search on onUnload event.
Last if you don't want to use ajax then you will need to rethink how you are getting the auto ID. Like maybe don't save an ID to the database until you have a record to save and then let the database create the ID number for you.
-
so inorder to tell when someone moves away from your site or closes the browser you will have to use javascript - NO.. i want to call my C# function
-
i agree with Freon, using a call back is the best way of doing it.
I have never worked with the 1.1 framework, so i can't really say how this would be done. .Net 2 gives us the clientscript.getcallbackeventreference to do it.
Research doing a call back in .net 1.1, you will probably find some great examples to help you through it.
Si
Post a reply
Related discussion
-
Selecting, Confirming & Deleting Multiple Checkbox Items In A DataGrid/GridView - Part 2: Maintaining CheckBox State Acr
by tony.s (15 replies)
-
Using ADO.NET with SQL Server
by Manjot Bawa (23 replies)
-
An Introduction to VB.NET and Database Programming
by carlosmen (14 replies)
-
Compatibility Issue on Firefox to display on Cursor Location
by dinc3r (1 replies)
-
String was not recognized as a valid DateTime.
by buvanasubi (22 replies)
Related articles
Quick links
Recent activity
- david freezea replied to Built-in dataset: an innova...
- Tina Chan replied to Create a path breaking tech...
- Norman Bethune replied to 4Easysoft MTS Converter (Wi...
- Norman Bethune replied to 4Easysoft MTS Converter (Wi...
- LOKE FOO SOON replied to How to set value to the clo...
- LOKE FOO SOON replied to How to set value to the clo...
Enter your message below
Sign in or Join us (it's free).