Click here to Skip to main content
15,884,986 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I want to disable the window browser close(X) while I am opening my ModalDialog box, which is small in size and contains buttons for OK and Close.

When the user clicks the 'Close' button the child page should be closed. It should not get closed while they are clicking browser close button.

XML
<script language="javascript" type="text/javascript">

        function Onclick()
        {


        RetVal = window.showModalDialog("CabinMappingChild.aspx","CabinMapping","dialogHeight: 190px; dialogWidth: 550px; titlebar: no; toolbar: no; statusbar:no");
        }
 </script>


I am using the above code but still I could not get it to work.


Can anyone please help me?
Posted
Updated 1-Sep-10 2:28am
v2
Comments
Sandeep Mewara 1-Sep-10 16:47pm    
Follow up question by OP:
No... i don;t want full screen option.....
Ok... is it possible to write function definition for (like in javascript) while user clicking browser close(x)???

You are not allowed to disable the close button in the browser for security reasons.

However... You can open the window in fullscreen size which means the browser automatically will hide the titlebar and the minimize, maximize, and close buttons!

To open a webform in fullscreen see below:

window.open('WebForm2.aspx', '', 'Fullscreen=yes');


Hope that helps!
 
Share this answer
 
Its not working on my button click event...
 
Share this answer
 
YOU CAN disable parent window.. See this link.

http://forums.asp.net/t/1212594.aspx/1[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900