PC Review


Reply
Thread Tools Rate Thread

Close pop-up and postback

 
 
=?Utf-8?B?TWFyZHk=?=
Guest
Posts: n/a
 
      10th Aug 2005
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
 
Reply With Quote
 
 
 
 
=?Utf-8?B?U3JlZWppdGggUmFt?=
Guest
Posts: n/a
 
      10th Aug 2005
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

 
Reply With Quote
 
=?Utf-8?B?TWFyZHk=?=
Guest
Posts: n/a
 
      10th Aug 2005
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

 
Reply With Quote
 
=?Utf-8?B?U3JlZWppdGggUmFt?=
Guest
Posts: n/a
 
      10th Aug 2005
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

 
Reply With Quote
 
=?Utf-8?B?TWFyZHk=?=
Guest
Posts: n/a
 
      11th Aug 2005


"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

 
Reply With Quote
 
=?Utf-8?B?TWFyZHk=?=
Guest
Posts: n/a
 
      11th Aug 2005
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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Any way to convert an async postback to a full postback incode-behind? Ed Cayce Microsoft ASP .NET 0 8th Aug 2009 12:23 AM
Using callback, I fill dorpdownlist without postback but it gets empty when a postback is executed Fabio Mastria Microsoft ASP .NET 4 22nd Jan 2008 01:46 PM
ShowDialogModal postback on close (this is not related to multiple dialogs opening upon postback) Jacky Chau Microsoft ASP .NET 2 8th Jun 2005 06:49 PM
Can I raise a postback ? Session variable only visible after postback. Please help gce Microsoft ASP .NET 2 8th May 2005 06:55 AM
Popup window will not close on IE6 XP_SP2 after postback Drew Berkemeyer Microsoft ASP .NET 7 24th Oct 2004 12:20 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:34 PM.