473,608 Members | 1,820 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Popup window will not close on IE6 XP_SP2 after postback

Hello,

We have an application that we have written using ASP.NET. On one of our
pages we open a popup window using javascript. The popup window has a save
and a cancel button. Both of them are server-side controls and do a
postback. While processing on the server we add javascript to the page load
(i.e. onload=window.o pener.focus(); window.close()) . However, the
window.close() command does not close the IE popup window.

This happens on both Internet and Local Intranet net zones.

We have tried adjusting the security settings all the way down to low and it
has no effect.

Can anyone help to shed some light on why this is not working.

Thank you in advance for your assistance.

Sincerely,
Drew Berkemeyer

Nov 18 '05 #1
7 2591
Not sure if this is relevant, but try: http://aspalliance.com/333 for
closing non-scripted windows (yours sounds scripted, but can't tell from your
note if "opener" is set right).

"Drew Berkemeyer" wrote:
Hello,

We have an application that we have written using ASP.NET. On one of our
pages we open a popup window using javascript. The popup window has a save
and a cancel button. Both of them are server-side controls and do a
postback. While processing on the server we add javascript to the page load
(i.e. onload=window.o pener.focus(); window.close()) . However, the
window.close() command does not close the IE popup window.

This happens on both Internet and Local Intranet net zones.

We have tried adjusting the security settings all the way down to low and it
has no effect.

Can anyone help to shed some light on why this is not working.

Thank you in advance for your assistance.

Sincerely,
Drew Berkemeyer

Nov 18 '05 #2
try window.opener.c lose().

I don't understand why you use a server side window instead of a simple
confirm in javascript.

"Drew Berkemeyer" <sp**@menow.com > ha scritto nel messaggio
news:ed******** ******@TK2MSFTN GP14.phx.gbl...
Hello,

We have an application that we have written using ASP.NET. On one of our
pages we open a popup window using javascript. The popup window has a save
and a cancel button. Both of them are server-side controls and do a
postback. While processing on the server we add javascript to the page
load
(i.e. onload=window.o pener.focus(); window.close()) . However, the
window.close() command does not close the IE popup window.

This happens on both Internet and Local Intranet net zones.

We have tried adjusting the security settings all the way down to low and
it
has no effect.

Can anyone help to shed some light on why this is not working.

Thank you in advance for your assistance.

Sincerely,
Drew Berkemeyer

Nov 18 '05 #3
Hi Drew,

As for the problem you mentioned, I've performed a simple test on my local
side. I use a XP Pro machine with SP2 installed and IE6. It seems that I
can close the popup window correctly via the script you provided. I'm
thinking there maybe something else which block the popup window from
closing. Is this problem occuring on many other machines on your side?
Anyway, here is the test pages I used, you may also have a try on your
side to see whether it'll return the same result:

============ope ner window========= ======
<body>
<form id="Form1" method="post" runat="server">
<table width="100%" align="center">
<TR>
<TD><input type="button" value="popup"
onclick="window .open('popuppag e.aspx');"/></TD>
</TR>
............... ..

==============p opuppage.aspx== ===========
<HTML>
<HEAD>
<title>popuppag e</title>
</HEAD>
<body runat="server" id="mybody">
<form id="Form1" method="post" runat="server">
<asp:Button id="Button1" style="Z-INDEX: 101; LEFT: 8px; POSITION:
absolute; TOP: 8px" runat="server"
Text="Button"></asp:Button>
</form>
</body>
</HTML>
===========popu ppage codebehind===== ====
private void Button1_Click(o bject sender, System.EventArg s e)
{
Page.RegisterSt artupScript("cl osescript","<sc ript
language='javas cript'>window.o pener.focus(); window.close(); </script>");
}

If there is any othe new findings, please also feel free to post here.
Thanks.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


Nov 18 '05 #4
OK. This is *very* similar to what we are doing.

I've created a new project that just includes the code you posted and it
works on my machine also. I will now try and narrow down the differences and
then post what I find.

*THANK YOU* very much for your timely response. It is greatly appreciated.

Sincerely,
Drew Berkemeyer

"Steven Cheng[MSFT]" <v-******@online.m icrosoft.com> wrote in message
news:83******** ******@cpmsftng xa10.phx.gbl...
Hi Drew,

As for the problem you mentioned, I've performed a simple test on my local
side. I use a XP Pro machine with SP2 installed and IE6. It seems that I
can close the popup window correctly via the script you provided. I'm
thinking there maybe something else which block the popup window from
closing. Is this problem occuring on many other machines on your side?
Anyway, here is the test pages I used, you may also have a try on your
side to see whether it'll return the same result:

============ope ner window========= ======
<body>
<form id="Form1" method="post" runat="server">
<table width="100%" align="center">
<TR>
<TD><input type="button" value="popup"
onclick="window .open('popuppag e.aspx');"/></TD>
</TR>
............... .

==============p opuppage.aspx== ===========
<HTML>
<HEAD>
<title>popuppag e</title>
</HEAD>
<body runat="server" id="mybody">
<form id="Form1" method="post" runat="server">
<asp:Button id="Button1" style="Z-INDEX: 101; LEFT: 8px; POSITION:
absolute; TOP: 8px" runat="server"
Text="Button"></asp:Button>
</form>
</body>
</HTML>
===========popu ppage codebehind===== ====
private void Button1_Click(o bject sender, System.EventArg s e)
{
Page.RegisterSt artupScript("cl osescript","<sc ript
language='javas cript'>window.o pener.focus(); window.close(); </script>");
}

If there is any othe new findings, please also feel free to post here.
Thanks.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #5
OK. It's fixed.

Here was the problem:

Our orginal code had a syntax error that appearantly only shows up under XP
SP2 as we do not have any problems with any other OS.

The original code looked like this:
strScript += "window.opener. focus();"
strScript += "onload=window. close " ' Note the lack of parens and
semicolon
strScript += "</SCRIPT>"

When I changed it to match your example:
strScript += "window.opener. focus();"
strScript += "window.close() ;"
strScript += "</SCRIPT>"

It works like a champ!

Thank you again for all of your assistance. Your example gave me what I
needed to solve this quickly.

Sincerely,
Drew Berkemeyer

"Steven Cheng[MSFT]" <v-******@online.m icrosoft.com> wrote in message
news:83******** ******@cpmsftng xa10.phx.gbl...
Hi Drew,

As for the problem you mentioned, I've performed a simple test on my local
side. I use a XP Pro machine with SP2 installed and IE6. It seems that I
can close the popup window correctly via the script you provided. I'm
thinking there maybe something else which block the popup window from
closing. Is this problem occuring on many other machines on your side?
Anyway, here is the test pages I used, you may also have a try on your
side to see whether it'll return the same result:

============ope ner window========= ======
<body>
<form id="Form1" method="post" runat="server">
<table width="100%" align="center">
<TR>
<TD><input type="button" value="popup"
onclick="window .open('popuppag e.aspx');"/></TD>
</TR>
............... .

==============p opuppage.aspx== ===========
<HTML>
<HEAD>
<title>popuppag e</title>
</HEAD>
<body runat="server" id="mybody">
<form id="Form1" method="post" runat="server">
<asp:Button id="Button1" style="Z-INDEX: 101; LEFT: 8px; POSITION:
absolute; TOP: 8px" runat="server"
Text="Button"></asp:Button>
</form>
</body>
</HTML>
===========popu ppage codebehind===== ====
private void Button1_Click(o bject sender, System.EventArg s e)
{
Page.RegisterSt artupScript("cl osescript","<sc ript
language='javas cript'>window.o pener.focus(); window.close(); </script>");
}

If there is any othe new findings, please also feel free to post here.
Thanks.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #6
Hi

A window opened by your app ( window.open ) should have no
problem closing with script... for others user will get a confirm on close
window

--
Best Regards
Vidar Petursson
=============== ===============
Microsoft Visual: Scripting MVP 2000-2004
http://www.icysoft.com/
http://www.deus-x.com/ Instant e-commerce
http://www.microsoft.com/technet/scriptcenter/
Playground: http://213.190.104.211/ ( IE 5.5+ only )

No matter where you go there you are
=============== ===============
"Cirrosi" <Ci************ ****@fastwebnet .it> wrote in message
news:07******** **********@torn ado.fastwebnet. it...
try window.opener.c lose().

I don't understand why you use a server side window instead of a simple
confirm in javascript.

"Drew Berkemeyer" <sp**@menow.com > ha scritto nel messaggio
news:ed******** ******@TK2MSFTN GP14.phx.gbl...
Hello,

We have an application that we have written using ASP.NET. On one of our
pages we open a popup window using javascript. The popup window has a
save
and a cancel button. Both of them are server-side controls and do a
postback. While processing on the server we add javascript to the page
load
(i.e. onload=window.o pener.focus(); window.close()) . However, the
window.close() command does not close the IE popup window.

This happens on both Internet and Local Intranet net zones.

We have tried adjusting the security settings all the way down to low and
it
has no effect.

Can anyone help to shed some light on why this is not working.

Thank you in advance for your assistance.

Sincerely,
Drew Berkemeyer


Nov 18 '05 #7
Hi Drew,

Thanks for your followup. I'm also very glad that the problem has been
figured out and my suggestions are of assistance. Please feel free to post
here when you need our help. Have a good day!
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
12421
by: HarveyB | last post by:
I would like to generate non-modal popup windows from ASP.Net code-behind. I have tried using Client Side scripting like "function Test(){ window.open('test.htm',_blank, 'height=200,width=400,status=no,toolbar=no, menubar=no,location=no resizable=no scrollable=no'); but I can't seem to invoke the client side script from within a Server Side Form. I know I can use the context with to Response.redirect or Server.transfer to return a
5
2504
by: Jay | last post by:
I have a situation where the user clicks on a button in a DataGrid to launch a popup window via javascript. In the popup window the user does some things that result in changes to the underlying database the DataGrid is using as a data source. When the popup window is closed I want to refresh the main window -- i.e., cause a postback to happen. Is this possible?
4
3000
by: SteveS | last post by:
Hello. This is a strange problem which does not make sense to me. I open a popup page with the following javascript code: function OpenDenyWindow(changeId) { retVal=window.showModalDialog('DenialEmailForm.aspx?id=1234'', 'dialogWidth:650px; dialogHeight:700px; resizable:no;'); //alert("Return val = " + retVal) }
20
439
by: ruca | last post by:
Hi, DESCRIPTION: I'm developing an application that when I need to insert a date, I use 3 textbox's and one image button. This image button open's a small popup window with a calendar, allowing user choose date. Then, this popup returns the year, month and day to the correspondent textbox. So far, so good. PROBLEM: The problem is that the applications opens so popup's as the number of
3
4544
by: EMW | last post by:
Hi, Is it possible with VB.NET and Javascript to popup a window, after a buttonclick, in which the user writes some text in a textbox and then when that window is closed with a button, the text is posted back to the aspx program? If it is possible, please let me know some articles about this? thanks,
1
11560
by: Earl Teigrob | last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at http://weblogs.asp.net/asmith/archive/2003/09/15/27684.aspx but it was far more complex then I needed. (I got lost trying to figure it all out). Therefore, here goes my simple "web dialog box with parent event handler fireing" solution. ...
1
1531
by: Sanjeev Mahajan via .NET 247 | last post by:
Hi All, I have a main page from which I am calling a popup page. Thepopup page has an editable grid and some other fields. There isalso a Save button on the popup page. When the user clicks theSave button on the popup page, I want to save the values in thedatagrid as a dataset into the ViewState of the main page. Can Iaccess the ViewState of the main page in the popup page? If not,what is the way out? Thanks, Sanjeev ...
1
3501
by: Matt Jensen | last post by:
Howdy I've got a ASP.NET webform page that pops up a window for a user to make a selection. Once they make a selection in this popup window, the form in the popup is submitted an update to the DB is fired, the window closes, and the opener window's (server) form is submitted (via JavaScript) (so that any form changes that were made are retained) and the newly loaded page shows the new selections from the popup window. However, the...
8
1898
by: JJ | last post by:
Whats the best way to pass a variable from a popup to the current page (without a postback on the current page). I have a form on 'page1' with various text input boxes. One box contains an image URL. To select the url , the user can click on a browse button to open a url chooser pop up ('page2'). I want the url that is selected in 'page2' to be posted back to 'page1' and displayed in the input box, without losing the values a user has...
0
8013
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8503
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8488
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8164
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8360
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6017
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5489
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3977
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2482
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.