Disabling the close button of a window..

Hi,

Can anybody plz help me out with the javascript or asp.net code to disable the close button of a
window..ie..I should not give the user the provision to close his/her window.
How can i do this..

Any suggestions are greatly appreciated..
Thanks in advance..

Regards
blob

Comments

  • Hi blob! I like your name!

    I don't know of any direct code to just simply prevent the close command, but you can use an Auto Macro to change the behaviour of the close command. Create a macro and call it "AutoClose" and an alternate way of preventing the user from exiting the application is to just re-open the file again. When you click to close a window or file, it will close regardless, but you can execute code after this with AutoClose. So in the code, just tell it to open the file again. It's not going to be as neat as preventing the user from closing at all, (actually far from it) but that's all I know on the topic. AutoOpen is another good one to use, running code whenever a file is opened.

    Faz
  • I Believe it tis impossible to disable the close button. However, you can Open javascript windows that hide the close button and toolbars ...


  • Hi Faz,

    Thank you for your immediate response..
    You have told that it is possible to use an AutoMacro to change the behaviour of the close command..Can you please give some ideas on this..ie..AutoMacro..

    In Internet Explorer, actually when a macro comes, due to some security issues,macros might be disabled right???..
    I need to submit the page with values to the server, when the user clicks the close window by mistake...Any suggestions on this please!!..

    Thanks in Advance..
    Regards
    blob

    : Hi blob! I like your name!
    :
    : I don't know of any direct code to just simply prevent the close command, but you can use an Auto Macro to change the behaviour of the close command. Create a macro and call it "AutoClose" and an alternate way of preventing the user from exiting the application is to just re-open the file again. When you click to close a window or file, it will close regardless, but you can execute code after this with AutoClose. So in the code, just tell it to open the file again. It's not going to be as neat as preventing the user from closing at all, (actually far from it) but that's all I know on the topic. AutoOpen is another good one to use, running code whenever a file is opened.
    :
    : Faz
    :

  • Hi iwilld0it,
    Thank you for your suggestion...I can hide the close button and toolbars..but still, the user can close the window by using short cut keys like alt+F4..How can i avoid this too..

    Thanks in advance
    Regards
    blob

    : I Believe it tis impossible to disable the close button. However, you can Open javascript windows that hide the close button and toolbars ...
    :
    :
    :

  • : Hi iwilld0it,
    : Thank you for your suggestion...I can hide the close button and toolbars..but still, the user can close the window by using short cut keys like alt+F4..How can i avoid this too..
    :
    : Thanks in advance
    : Regards
    : blob
    :
    : : I Believe it tis impossible to disable the close button. However, you can Open javascript windows that hide the close button and toolbars ...
    : :
    : :
    : :
    :
    :
    why would you want to do this? it seems as if it would be very intrusive to a user. also, alt+f4 cannot be disabled as far as i'm aware, and also, they could always just go to the task manager and kill the process. either way, disabling the ability to close a window is generally not a good way to get people to stick around your site (well, besides the fact that they can't close the window)
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories