473,756 Members | 3,390 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

closing a popup form

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.s howModalDialog( 'DenialEmailFor m.aspx?id=1234' ',
'dialogWidth:65 0px; dialogHeight:70 0px; resizable:no;') ;
//alert("Return val = " + retVal)
}
The screen opens fine. However, I can't get it to close after I the user
submits the form. I run this code in my click event:

Response.Write( "<script language='javas cript'>window.c lose();</script>")
OR
Page.RegisterSt artupScript("Au toClose", "<script language
=""javascript"" >window.close() ;</script" & ">")

Both of these statements do not work.

The problem gets more interesting. If I don't try to close the form, then a
duplicate popup form appears. Now, I have 2 popup forms!

Make sense?

This has me bewildered! Any ideas what is going on?

Thank you for your help!!

SteveS

Nov 18 '05 #1
4 3012

"SteveS" <ss*****@trendm ls.com> wrote in message
news:#g******** ******@TK2MSFTN GP10.phx.gbl...
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.s howModalDialog( 'DenialEmailFor m.aspx?id=1234' ',
'dialogWidth:65 0px; dialogHeight:70 0px; resizable:no;') ;
//alert("Return val = " + retVal)
}
The screen opens fine. However, I can't get it to close after I the user
submits the form. I run this code in my click event:

Response.Write( "<script language='javas cript'>window.c lose();</script>")
OR
Page.RegisterSt artupScript("Au toClose", "<script language
=""javascript"" >window.close() ;</script" & ">")

Both of these statements do not work.

The problem gets more interesting. If I don't try to close the form, then a duplicate popup form appears. Now, I have 2 popup forms!

Make sense?

This has me bewildered! Any ideas what is going on?

Thank you for your help!!

SteveS

where is the form submitted ? if it is submitted to itself you are probably
seeing is close and then re-open again !

Nov 18 '05 #2
The popup form is submitted to itself through this button:

<asp:Button ID="btnSend" Runat="server" Text="Send Denial"></asp:Button>

Then, the click event in the code-behind sends the javascript to the page:

Private Sub btnSend_Click(B yVal sender As Object, ByVal e As
System.EventArg s) Handles btnSend.Click
...do stuff....
CloseWindow()
End Sub

Private Sub CloseWindow()
'Response.Write ("<script
language='javas cript'>window.c lose();</script>")
Page.RegisterSt artupScript("Au toClose", "<script language
=""javascript"" >window.parent. close();window. close();</script" & ">")
End Sub

So, do you think when a button is clicked on the popup form, it create
another browser window? How can I get around this?

"Zoe Brown" <zo*******@d-o-n-o-t-s-p-a-m-tfn.com> wrote in message
news:40******** @primark.com...

"SteveS" <ss*****@trendm ls.com> wrote in message
news:#g******** ******@TK2MSFTN GP10.phx.gbl...
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.s howModalDialog( 'DenialEmailFor m.aspx?id=1234' ',
'dialogWidth:65 0px; dialogHeight:70 0px; resizable:no;') ;
//alert("Return val = " + retVal)
}
The screen opens fine. However, I can't get it to close after I the user submits the form. I run this code in my click event:

Response.Write( "<script language='javas cript'>window.c lose();</script>")
OR
Page.RegisterSt artupScript("Au toClose", "<script language
=""javascript"" >window.close() ;</script" & ">")

Both of these statements do not work.

The problem gets more interesting. If I don't try to close the form,
then a
duplicate popup form appears. Now, I have 2 popup forms!

Make sense?

This has me bewildered! Any ideas what is going on?

Thank you for your help!!

SteveS

where is the form submitted ? if it is submitted to itself you are

probably seeing is close and then re-open again !


Nov 18 '05 #3
The popup form is submitted to itself through this button:

<asp:Button ID="btnSend" Runat="server" Text="Send Denial"></asp:Button>

Then, the click event in the code-behind sends the javascript to the page:

Private Sub btnSend_Click(B yVal sender As Object, ByVal e As
System.EventArg s) Handles btnSend.Click
...do stuff....
CloseWindow()
End Sub

Private Sub CloseWindow()
'Response.Write ("<script
language='javas cript'>window.c lose();</script>")
Page.RegisterSt artupScript("Au toClose", "<script language
=""javascript"" >window.parent. close();window. close();</script" & ">")
End Sub

So, do you think when a button is clicked on the popup form, it create
another browser window? How can I get around this?

"Zoe Brown" <zo*******@d-o-n-o-t-s-p-a-m-tfn.com> wrote in message
news:40******** @primark.com...

"SteveS" <ss*****@trendm ls.com> wrote in message
news:#g******** ******@TK2MSFTN GP10.phx.gbl...
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.s howModalDialog( 'DenialEmailFor m.aspx?id=1234' ',
'dialogWidth:65 0px; dialogHeight:70 0px; resizable:no;') ;
//alert("Return val = " + retVal)
}
The screen opens fine. However, I can't get it to close after I the user submits the form. I run this code in my click event:

Response.Write( "<script language='javas cript'>window.c lose();</script>")
OR
Page.RegisterSt artupScript("Au toClose", "<script language
=""javascript"" >window.close() ;</script" & ">")

Both of these statements do not work.

The problem gets more interesting. If I don't try to close the form,
then a
duplicate popup form appears. Now, I have 2 popup forms!

Make sense?

This has me bewildered! Any ideas what is going on?

Thank you for your help!!

SteveS

where is the form submitted ? if it is submitted to itself you are

probably seeing is close and then re-open again !


Nov 18 '05 #4
Hi

To prevent a new page opening set the base target in the dialog
<base target="_self">
http://msdn.microsoft.com/library/de...ies/target.asp

Or use a iframe in the dialog and host the page there

After a postback success return a script to close the dialog
<script>window. close();</script>

--
Best Regards
Vidar Petursson
=============== ===============
Microsoft Scripting MVP
http://www.microsoft.com/technet/scriptcenter
=============== ===============
"SteveS" <ss*****@trendm ls.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
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.s howModalDialog( 'DenialEmailFor m.aspx?id=1234' ',
'dialogWidth:65 0px; dialogHeight:70 0px; resizable:no;') ;
//alert("Return val = " + retVal)
}
The screen opens fine. However, I can't get it to close after I the user
submits the form. I run this code in my click event:

Response.Write( "<script language='javas cript'>window.c lose();</script>")
OR
Page.RegisterSt artupScript("Au toClose", "<script language
=""javascript"" >window.close() ;</script" & ">")

Both of these statements do not work.

The problem gets more interesting. If I don't try to close the form, then
a
duplicate popup form appears. Now, I have 2 popup forms!

Make sense?

This has me bewildered! Any ideas what is going on?

Thank you for your help!!

SteveS

Nov 18 '05 #5

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

Similar topics

1
2460
by: MJEASSOC | last post by:
I need some help with closing a popup window. I'm making an online portfolio, that has one base page with text and thumbnails. When a user clicks on a thumb, a new window opens containing a larger image and a caption (each contained on a separate htm document). I do this with a function in the header script as follows: var picpage=" "; var params=" ";
4
2633
by: Ellen Manning | last post by:
Using A2K. I have a form that allows the user to print one or more reports. The user checks which report they want printed then they click on a button to start printing. A popup form displays when they click on the button and prompts them for a date range. This date range is then used on each report. (I make the popup invisible when the range is entered. So it's open during the printing so that the reports can access the date range.)...
4
5873
by: deko | last post by:
I have a pop-up form in which user-defined parameters are entered. The parameters are entered into a subform datasheet which is bound to a table. I need to check the product of two parameters to make sure they are valid before updating them (or closing the popup form), so I use this code: Private Function BadValue() As Boolean If Me!Die * Me!Site > 32000 Or Me!Die * Me!Site < 0 Then MsgBox "Die and/or Site out of range." & vbCrLf &...
3
313
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) }
3
1738
by: thechaosengine | last post by:
Hi all, I need to be able to cause the following chain of events after clicking an asp:button but I don't know how to do it. I'd really appreciate any advice on this or alternative approaches: The window in question is a popup asking the user to provide some details. The primary window is still open in the background 1. Button on popup clicked
4
2917
by: rdemyan | last post by:
I'm using code from the following web page to open the API Browse Folder dialog http://www.mvps.org/access/api/api0002.htm It all works fine. But if the dialog box is open and the user closes Access, the system just hangs and Access apparantly cannot close. I have to open the Windows Task Manager and force the closing (and even that takes quite awhile).
1
5197
by: Tyrone Slothrop | last post by:
Any idea of why this will not work? I have an image editor in a popup that is opened from a form in a window containing data as well as displaying images for the record. When the image has been saved, it posts to the form in the opener from the popup, updating the record with the new image. Everything is working perfectly but the popup refuses to close. After the image is saved to the server, this is the HTML which is generated:
4
8850
by: Macbane | last post by:
Hi, I have a 'main' form called frmIssues which has a subform control (named linkIssuesDrug) containing the subform sfrmLink_Issues_Drugs. A control button on the main form opens a pop-up form which allows me to edit the record in the subform. What I want to happen is for subform with the new edits to be updated on the main form when I close the popup. I'm sure this is a very small bit of code in the the 'On close' event for the popup...
3
1947
by: =?Utf-8?B?Vk1J?= | last post by:
How can I close popup window automatically when I close the parent window (the application itself)? Thanks.
0
9455
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9271
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
10031
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
9869
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...
0
9708
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...
0
8709
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6534
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
5302
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2665
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.