Connecting Tech Pros Worldwide Forums | Help | Site Map

Refresh Parent Page

Ben Schumacher
Guest
 
Posts: n/a
#1: Mar 15 '06
How can I refresh the parent page from a popup window that was created using
window.showmodaldialog? I would like to accomplish this using vbscript if
possible.



Winista
Guest
 
Posts: n/a
#2: Mar 15 '06

re: Refresh Parent Page


You can always use java script to refresh the parent page...

window.opener.callMyRefreshFunction();

--
Netomatix
http://www.netomatix.com
"Ben Schumacher" <bschumacher@navegate.com> wrote in message
news:eK6SliFSGHA.4920@tk2msftngp13.phx.gbl...[color=blue]
> How can I refresh the parent page from a popup window that was created
> using window.showmodaldialog? I would like to accomplish this using
> vbscript if possible.
>[/color]


Ben Schumacher
Guest
 
Posts: n/a
#3: Mar 15 '06

re: Refresh Parent Page


I don't want to call call a routine on the parent page. I want to handle
everything in the modaldialogwindow popup window.


"Winista" <naveenkohli@hotmail.com> wrote in message
news:%23JX2IlFSGHA.224@TK2MSFTNGP10.phx.gbl...[color=blue]
> You can always use java script to refresh the parent page...
>
> window.opener.callMyRefreshFunction();
>
> --
> Netomatix
> http://www.netomatix.com
> "Ben Schumacher" <bschumacher@navegate.com> wrote in message
> news:eK6SliFSGHA.4920@tk2msftngp13.phx.gbl...[color=green]
>> How can I refresh the parent page from a popup window that was created
>> using window.showmodaldialog? I would like to accomplish this using
>> vbscript if possible.
>>[/color]
>
>[/color]


Winista
Guest
 
Posts: n/a
#4: Mar 15 '06

re: Refresh Parent Page


I was just giving an example of calling routine. You can access any JS
variables (control instances etc.)on parent page from child window. You will
have to do it via JS.
What exactly you are trying to do then I may be able to give you more
specific answer about refreshing UI on parent page.

--
Netomatix
http://www.netomatix.com
"Ben Schumacher" <bschumacher@navegate.com> wrote in message
news:u5U6dqFSGHA.4976@TK2MSFTNGP11.phx.gbl...[color=blue]
>I don't want to call call a routine on the parent page. I want to handle
>everything in the modaldialogwindow popup window.
>
>
> "Winista" <naveenkohli@hotmail.com> wrote in message
> news:%23JX2IlFSGHA.224@TK2MSFTNGP10.phx.gbl...[color=green]
>> You can always use java script to refresh the parent page...
>>
>> window.opener.callMyRefreshFunction();
>>
>> --
>> Netomatix
>> http://www.netomatix.com
>> "Ben Schumacher" <bschumacher@navegate.com> wrote in message
>> news:eK6SliFSGHA.4920@tk2msftngp13.phx.gbl...[color=darkred]
>>> How can I refresh the parent page from a popup window that was created
>>> using window.showmodaldialog? I would like to accomplish this using
>>> vbscript if possible.
>>>[/color]
>>
>>[/color]
>
>[/color]


Ben Schumacher
Guest
 
Posts: n/a
#5: Mar 15 '06

re: Refresh Parent Page


Ok. I have a page with a gridview control which is used to display a list
of records in a database table(s). If the user wants to add a new record,
they click "new" and a popup window displays. The popup window accepts data
from the user (name, number, date, etc) and is then submitted back to the
server when the users clicks an ok button. At this point I want to update
the database with the new record, close the popup window, and then refresh
the parent page so that it reflects the newly added record that was created
using the popup window.



"Winista" <naveenkohli@hotmail.com> wrote in message
news:edDt78FSGHA.2300@TK2MSFTNGP11.phx.gbl...[color=blue]
>I was just giving an example of calling routine. You can access any JS
>variables (control instances etc.)on parent page from child window. You
>will have to do it via JS.
> What exactly you are trying to do then I may be able to give you more
> specific answer about refreshing UI on parent page.
>
> --
> Netomatix
> http://www.netomatix.com
> "Ben Schumacher" <bschumacher@navegate.com> wrote in message
> news:u5U6dqFSGHA.4976@TK2MSFTNGP11.phx.gbl...[color=green]
>>I don't want to call call a routine on the parent page. I want to handle
>>everything in the modaldialogwindow popup window.
>>
>>
>> "Winista" <naveenkohli@hotmail.com> wrote in message
>> news:%23JX2IlFSGHA.224@TK2MSFTNGP10.phx.gbl...[color=darkred]
>>> You can always use java script to refresh the parent page...
>>>
>>> window.opener.callMyRefreshFunction();
>>>
>>> --
>>> Netomatix
>>> http://www.netomatix.com
>>> "Ben Schumacher" <bschumacher@navegate.com> wrote in message
>>> news:eK6SliFSGHA.4920@tk2msftngp13.phx.gbl...
>>>> How can I refresh the parent page from a popup window that was created
>>>> using window.showmodaldialog? I would like to accomplish this using
>>>> vbscript if possible.
>>>>
>>>
>>>[/color]
>>
>>[/color]
>
>[/color]


Peter Bromberg [C# MVP]
Guest
 
Posts: n/a
#6: Mar 15 '06

re: Refresh Parent Page


You need to emit client script into the page. A literal way to do it:

Response.Write("<script>window.opener.location.hre f=window.opener.location.href;</script>");

That's C#, but in VBScript you only need to add the language attribute to
the script tag and remove any semicolons. Javascript is better as only IE
understands VBscript.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




"Ben Schumacher" wrote:
[color=blue]
> How can I refresh the parent page from a popup window that was created using
> window.showmodaldialog? I would like to accomplish this using vbscript if
> possible.
>
>
>[/color]
Ben Schumacher
Guest
 
Posts: n/a
#7: Mar 16 '06

re: Refresh Parent Page


when i just try to look at what the href property is of the opener object
i'm getting Object required: 'window.opener'. Here is the code I'm using in
the popup window that is created using window.showmodaldialog.

<script language="vbscript" type="text/vbscript">

Sub window_onload()

document.write(window.opener.location.href)

End Sub

</script>

Any more ideas?


"Peter Bromberg [C# MVP]" <pbromberg@yahoo.nospammin.com> wrote in message
news:89F6F767-6EF4-4BF3-83BE-CD24922BA4D4@microsoft.com...[color=blue]
> You need to emit client script into the page. A literal way to do it:
>
> Response.Write("<script>window.opener.location.hre f=window.opener.location.href;</script>");
>
> That's C#, but in VBScript you only need to add the language attribute to
> the script tag and remove any semicolons. Javascript is better as only IE
> understands VBscript.
> Peter
>
> --
> Co-founder, Eggheadcafe.com developer portal:
> http://www.eggheadcafe.com
> UnBlog:
> http://petesbloggerama.blogspot.com
>
>
>
>
> "Ben Schumacher" wrote:
>[color=green]
>> How can I refresh the parent page from a popup window that was created
>> using
>> window.showmodaldialog? I would like to accomplish this using vbscript
>> if
>> possible.
>>
>>
>>[/color][/color]


carl
Guest
 
Posts: n/a
#8: Mar 16 '06

re: Refresh Parent Page


Ben,

Unfortuntately, Window.Opener isn't an object when you use
Showmodaldialog. To access the opener window object you can pass a
reference to it like this:

<parent-page>
window.showModalDialog( 'modal_window.aspx', window, '' );
</parent-page>

<modal-window>
var parentWindow = window.dialogArguments;
document.write(parentWindow.location.href);
</modal-window>

This may not work on all browsers, check documentation for browser
support other than IE.

I hope this helps,
Carl

Closed Thread