Solved

How to Disable Browser's Close Button when Page open using ShowModalDialog()

Posted on 2011-03-22
2
512 Views
Last Modified: 2012-06-21
lnkViewReport.Attributes.Add("onClick", "window.showModalDialog('Page.aspx?ID=" & ID.Text & "&View=Y&Print=N" & "','','dialogHeight:700px;dialogWidth:1000px')") 'Open Page
0
Comment
Question by:Jinal_Shah
2 Comments
 
LVL 53

Accepted Solution

by:
Dhaest earned 500 total points
Comment Utility
When you use window.open, you can set titlebar to no or 0, but it is usually ignored, see http://www.w3schools.com/jsref/met_win_open.asp.

An alternative is to create a draggable div instead of a popup.

Another alternative is in case you want to call a javascript function before closing the window you may use the 'onbeforeunload'-event ... normally i think this is the typical reason to want to have the close-button disabled ... so you may capture the closing of the window and may do something you want in that case ...


0
 

Author Closing Comment

by:Jinal_Shah
Comment Utility
i have already done this but not used.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines. The key components of Window…
#Citrix #Internet Explorer #Enterprise Mode #IE 11 #IE 8
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now