Solved

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

Posted on 2011-03-22
2
519 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
ID: 35196379
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
ID: 35340275
i have already done this but not used.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

914 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

23 Experts available now in Live!

Get 1:1 Help Now