Take a look at:
http://www.guyfromchennai.
Main Topics
Browse All TopicsI have a web app with the code behind in VB.Net.
At one point, when the user clicks a button I open a modal dialog, for example:
OnClientClick="var retvalue = window.showModalDialog('KT
In my Page Load, I use this code to set up the function of my "Cancel" button, for example:
Cancel_Button.Attributes.A
When the user clicks the Cancel button in the modal dialog, the dialog use to close properly.
But now, some users have migrated to IE 8. When they click Cancel the button to close the dialog, it does the following:
1. User clicks Cancel Button
2. The dialog sort of "flashes" and then reappears but this time it has expanded in size to the same size as the parent page.
3. The user clicks the Cancel button again.
4. A dialog appears from Windows Internet Explorer: The webpage you are viewing is trying to close the window. Do you want to close this window? Yes or No.
How do I close the window without this annoying glitch? Without having to tell my thousands of users to change a setting in IE, because that would be cumbersome, and I am sure they would not like to have to do that.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Take a look at:
http://www.guyfromchennai.
Protujh -- I looked at your referenced link. In post 77 was an example that said it worked for all IE versions. I set my code up within VB as in the attached. I get a build error in the top.window.open. How can I correct that?
In addition, I want to be sure this code does not reopen the parent. I just want to close the modal dialog form I have open without triggering an kind of postback on the parent.
I solved it!!
Include an HTML tag in the modal dialog as follows:
<base target="_self">
</base>
Here are the 3 elements I used in combination to call a modal dialog and close it without the extra Windows warning dialog. This works with IE8 and IE7 (I have no way to test IE6 or IE5).
1. The tag for the button that calls the modal dialog:
<asp:Button ID="CallModalDialogBtn" runat="server" Font-Names="Arial" Font-Size="8pt"
Height="19px" OnClientClick="var retvalue = window.showModalDialog('My
Text="Call Modal Dialog" Width="60px" />
2. The VB in the modal dialog Page_Load:
Cancel_Button.At
or, if you need to save data, in the VB code behind for the Save button, you could do
Save_Data()
Response.Writ
3. In the HTML for the modal dialog:
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="MyModalDialog.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<base target="_self">
</base>
Business Accounts
Answer for Membership
by: ProtuhjPosted on 2009-08-28 at 11:02:09ID: 25210099
It is possible that it is a bug in IE8.