473,503 Members | 1,635 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Close pop-up and postback

Hello

I'm trying to use a pop-up to capture some information and then return the
user to a datagrid containing the changes made in the pop-up.

I have the database update working and the pop-up opens and closes correctly
but I need to find a way to cause the datagrid to refresh once the pop up
closes. How can I force a postback once the pop-up closes?

Thank you
Nov 19 '05 #1
5 9578
You will need to get the handle of the Parent Window and call
Forms[0].Submit(); from the popup.

I think the syntax is
self.opener.window.document.forms[0].submit();

"Mardy" wrote:
Hello

I'm trying to use a pop-up to capture some information and then return the
user to a datagrid containing the changes made in the pop-up.

I have the database update working and the pop-up opens and closes correctly
but I need to find a way to cause the datagrid to refresh once the pop up
closes. How can I force a postback once the pop-up closes?

Thank you

Nov 19 '05 #2
I saw another source with similar advice but am having trouble with it
I have the following code in a sub in the codebehind of my pop up window.

Dim strUpdate As String = "<script language='Javascript'>Update
=self.opener.window.document.forms(0).submit();</script>"
Page.RegisterClientScriptBlock("Update", strUpdate)

I don't get any errors but the original page doesn't update either

"Sreejith Ram" wrote:
You will need to get the handle of the Parent Window and call
Forms[0].Submit(); from the popup.

I think the syntax is
self.opener.window.document.forms[0].submit();

"Mardy" wrote:
Hello

I'm trying to use a pop-up to capture some information and then return the
user to a datagrid containing the changes made in the pop-up.

I have the database update working and the pop-up opens and closes correctly
but I need to find a way to cause the datagrid to refresh once the pop up
closes. How can I force a postback once the pop-up closes?

Thank you

Nov 19 '05 #3
It could be few different reasons for it to not working

self.opener.window.document.forms(0).submit() will work only if you are
opening the pop up with winodw.open command. if it is a ModalDialog
,self.opener will be null..

If you have any Frames/Iframes in Parent window , opener.window.document
will rfer to the document in the frame.. you may need the reference to the
document with form in it.

To test if reference is correct , try placing a simple HTML Button in the
popup and call this self.opener.window.document.forms(0).submit() onclick of
it.
"Mardy" wrote:
I saw another source with similar advice but am having trouble with it
I have the following code in a sub in the codebehind of my pop up window.

Dim strUpdate As String = "<script language='Javascript'>Update
=self.opener.window.document.forms(0).submit();</script>"
Page.RegisterClientScriptBlock("Update", strUpdate)

I don't get any errors but the original page doesn't update either

"Sreejith Ram" wrote:
You will need to get the handle of the Parent Window and call
Forms[0].Submit(); from the popup.

I think the syntax is
self.opener.window.document.forms[0].submit();

"Mardy" wrote:
Hello

I'm trying to use a pop-up to capture some information and then return the
user to a datagrid containing the changes made in the pop-up.

I have the database update working and the pop-up opens and closes correctly
but I need to find a way to cause the datagrid to refresh once the pop up
closes. How can I force a postback once the pop-up closes?

Thank you

Nov 19 '05 #4


"Sreejith Ram" wrote:
It could be few different reasons for it to not working

self.opener.window.document.forms(0).submit() will work only if you are
opening the pop up with winodw.open command. if it is a ModalDialog
,self.opener will be null..

If you have any Frames/Iframes in Parent window , opener.window.document
will rfer to the document in the frame.. you may need the reference to the
document with form in it.

To test if reference is correct , try placing a simple HTML Button in the
popup and call this self.opener.window.document.forms(0).submit() onclick of
it.
"Mardy" wrote:
I saw another source with similar advice but am having trouble with it
I have the following code in a sub in the codebehind of my pop up window.

Dim strUpdate As String = "<script language='Javascript'>Update
=self.opener.window.document.forms(0).submit();</script>"
Page.RegisterClientScriptBlock("Update", strUpdate)

I don't get any errors but the original page doesn't update either

"Sreejith Ram" wrote:
You will need to get the handle of the Parent Window and call
Forms[0].Submit(); from the popup.

I think the syntax is
self.opener.window.document.forms[0].submit();

"Mardy" wrote:

> Hello
>
> I'm trying to use a pop-up to capture some information and then return the
> user to a datagrid containing the changes made in the pop-up.
>
> I have the database update working and the pop-up opens and closes correctly
> but I need to find a way to cause the datagrid to refresh once the pop up
> closes. How can I force a postback once the pop-up closes?
>
> Thank you

Nov 19 '05 #5
I am using window.open
no frames
I stumbled across this change and it does the job...I added this to
window.close script.

+"opener.location='parentPage.aspx';self.close( )

By reloading the page I get what I need.

The button test did not work.

Thanks

"Sreejith Ram" wrote:
It could be few different reasons for it to not working

self.opener.window.document.forms(0).submit() will work only if you are
opening the pop up with winodw.open command. if it is a ModalDialog
,self.opener will be null..

If you have any Frames/Iframes in Parent window , opener.window.document
will rfer to the document in the frame.. you may need the reference to the
document with form in it.

To test if reference is correct , try placing a simple HTML Button in the
popup and call this self.opener.window.document.forms(0).submit() onclick of
it.
"Mardy" wrote:
I saw another source with similar advice but am having trouble with it
I have the following code in a sub in the codebehind of my pop up window.

Dim strUpdate As String = "<script language='Javascript'>Update
=self.opener.window.document.forms(0).submit();</script>"
Page.RegisterClientScriptBlock("Update", strUpdate)

I don't get any errors but the original page doesn't update either

"Sreejith Ram" wrote:
You will need to get the handle of the Parent Window and call
Forms[0].Submit(); from the popup.

I think the syntax is
self.opener.window.document.forms[0].submit();

"Mardy" wrote:

> Hello
>
> I'm trying to use a pop-up to capture some information and then return the
> user to a datagrid containing the changes made in the pop-up.
>
> I have the database update working and the pop-up opens and closes correctly
> but I need to find a way to cause the datagrid to refresh once the pop up
> closes. How can I force a postback once the pop-up closes?
>
> Thank you

Nov 19 '05 #6

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

Similar topics

9
3226
by: Graham | last post by:
What I currently have is a page that opens another browser at 800x600, once that is loaded I would like to close the orginal page down while keeping the page that it has just opened open (To make...
5
6925
by: GEL | last post by:
Hi, I want to open a new browser window, let the user use that window for several minutes, and when they close, I'd like to change the page displayed in the original window. According to...
6
12795
by: Sujan | last post by:
Hello all, Help me! -------------------- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <script language="JavaScript"> <!--
4
34831
by: GrantS | last post by:
I am having a problem closing a popup window opened modally. When I try to close the window (when the user hits save button and the data has been processed), the Popup window opens as a full screen...
2
4982
by: Chien Lau | last post by:
Hi, At a certain point in my application, I have access to a Form object. I want to close that form: form.Close(); There are any number of reasons why this form might not close. A common...
6
1520
by: tabakaka | last post by:
what is the condition if i want to pop a new window once i close the current one? is it..? if window.close { window.open("abc.aspx", "abc",...
1
3975
by: pbd22 | last post by:
Hi all. I am using styles to lock down the GUI until the user enters some info in a CSS/DIV pop box. If the user does now scroll before he clicks, the pop box is centered and the background...
2
1193
by: =?iso-8859-1?Q?Cleber_Sch=F6nhofen?= | last post by:
Hi, I have a pop that runs from n n in minutes, but the times when a pop are running your connection to the database is closed by another. Does anyone know how to avoid it ? -- Cleber Schönhofen...
5
2119
Frinavale
by: Frinavale | last post by:
This might be a very newbieish question but here it goes. I have a control that "pops out" when the user clicks a link. The control is a <div> element with some stuff in it that is...
0
7202
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,...
0
7086
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...
0
7332
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...
0
7462
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...
0
5578
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,...
0
3167
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...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1512
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 ...
0
382
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...

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.