Running Function after popup close's

Discussion in 'ASP .Net' started by ruca, May 2, 2005.

  1. ruca

    ruca Guest

    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
    ruca, May 2, 2005
    #1
    1. Advertising

  2. ruca

    Cor Ligthert Guest

    Ruca

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

    Cor
    Cor Ligthert, May 2, 2005
    #2
    1. Advertising

  3. ruca

    ruca Guest

    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" <> escreveu na mensagem
    news:...
    > Ruca
    >
    > What is in your opinion a popup window
    > A new window
    > A prompt
    > an alert
    >
    > Cor
    >
    ruca, May 2, 2005
    #3
  4. ruca

    Cor Ligthert Guest

    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
    Cor Ligthert, May 2, 2005
    #4
  5. 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();
    }
    Johan Nordberg, May 2, 2005
    #5
  6. ruca

    Guest

    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
    , May 2, 2005
    #6
  7. How do you open the new window?

    Eliyahu

    "ruca" <> wrote in message
    news:...
    > 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" <> escreveu na mensagem
    > news:...
    > > Ruca
    > >
    > > What is in your opinion a popup window
    > > A new window
    > > A prompt
    > > an alert
    > >
    > > Cor
    > >

    >
    >
    Eliyahu Goldin, May 2, 2005
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Drew Berkemeyer
    Replies:
    7
    Views:
    5,869
    Steven Cheng[MSFT]
    Oct 24, 2004
  2. Iñaki Baz Castillo
    Replies:
    7
    Views:
    824
    Iñaki Baz Castillo
    Jan 12, 2010
  3. Jens Peter Hansen
    Replies:
    7
    Views:
    500
    Randy Webb
    Jun 19, 2004
  4. Replies:
    2
    Views:
    449
  5. Gabriella

    Cannot close popup window after submit

    Gabriella, Jan 22, 2007, in forum: Javascript
    Replies:
    4
    Views:
    454
Loading...

Share This Page