?
Solved

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

Posted on 2011-03-22
2
Medium Priority
?
566 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 1000 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…
Suggested Courses
Course of the Month14 days, 19 hours left to enroll

839 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