By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,030 Members | 1,323 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,030 IT Pros & Developers. It's quick & easy.

Running Function after popup close's

P: n/a
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???
--
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
Nov 21 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Ruca

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

Cor
Nov 21 '05 #2

P: n/a
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
"Cor Ligthert" <no************@planet.nl> escreveu na mensagem
news:uV**************@TK2MSFTNGP10.phx.gbl...
Ruca

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

Cor

Nov 21 '05 #3

P: n/a
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
Nov 21 '05 #4

P: n/a
How do you open the new window?

Eliyahu

"ruca" <ru***@iol.pt> wrote in message
news:u7**************@TK2MSFTNGP14.phx.gbl...
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
"Cor Ligthert" <no************@planet.nl> escreveu na mensagem
news:uV**************@TK2MSFTNGP10.phx.gbl...
Ruca

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

Cor


Nov 21 '05 #5

P: n/a
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();
}

Nov 21 '05 #6

P: n/a
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("callfunctiononcallingp age",
strScript)
End Sub

Bill E.
Hollywood, FL

Nov 21 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.