Community discussion forum

DISABLING/HIDING THE CLOSE BUTTON!?

  • 1 year ago

    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.

  • 1 year ago

    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

  • 1 year ago

    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?

  • 1 year ago

    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

  • 1 year ago

    thanks Slicksim. may i know how to achieve it?

  • 1 year ago

    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.

  • 1 year ago

    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?.....

                           

  • 1 year ago

    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

  • 1 year ago

    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

     
  • 1 year ago

    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
  • 1 year ago

    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

  • 1 year ago

    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
  • 1 year ago

    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 

  • 1 year ago

    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..

  • 1 year ago

    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

  • 1 year ago

    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

  • 1 year ago

    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

  • 1 year ago

    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.

     

     

  • 1 year ago

    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

  • 1 year ago

    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

Enter your message below

Sign in or Join us (it's free).

Want to stay in touch with what's going on? Follow us on twitter!