Running Function after popup close's

  • Thread starter Thread starter ruca
  • Start date Start date
R

ruca

Hi,

How can I force to run a function when a popup window close's???

This function it's present in parent window. Can I run it after popup window
close's???
How can I do that???
 
Ruca

What is in your opinion a popup window
A new window
A prompt
an alert

Cor
 
In this case I mean a New Window and that will return some values to parent
window.

Then can I run a function of parent window when popup is closed???
 
Ruca,

I don't kow that anymore. For the VBNet part is in my opinion the most
simple thing to use a (hidden) textbox that you fill by a javascript
function.

I see that you have crossposted this message as well to dotnet jScript. I
have it not at hand at the moment. I would in your case as well try it just
in one of those endless javascript sides.

One of them
http://javascript.internet.com/

I hope this helps anyway

Cor
 
For IE you can use the window.showModalDialog() method. This pauses the
function until the dialog closes, they you can get the returned value
from the dialog.

In page that open the dialog:

function showDialog()
{
var dialog = window.showModalDialog("dialog.aspx", params,
"dialogWidth: 400px; dialogHeight: 300px;");
if(dialog != null)
// use the result here
}

In the dialog:
function init()
{
params = window.dialogArguments
// do stuff with params
}

function submitHandler()
{
// do stuff
window.returnValue = returnStuff;
window.close();
}
 
I normally place a "Close" or "Go" button on the popup. When this is
clicked, I place javascript into the dialog that runs the function on
the calling page as follows:

Sub CallFunctionOnCallingPage (ByVal obj As Object, ByVal e As
EventArgs) Handles lnkgo.Click

'Write the script to close and refresh the calling page
Dim strScript As String = "<script language=javascript>" &
vbCrLf
strScript += vbTab & "self.opener.myfunctiononcallingpage();"
strScript += vbTab & "window.close();"
strScript += "</script>"
Page.RegisterStartupScript("callfunctiononcallingpage",
strScript)
End Sub

Bill E.
Hollywood, FL
 
How do you open the new window?

Eliyahu

ruca said:
In this case I mean a New Window and that will return some values to parent
window.

Then can I run a function of parent window when popup is closed???


--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top