closing showModalDialog window from server side

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default closing showModalDialog window from server side

    I have a simple page that I will like to display while i
    am processing the user request in the server. The page
    only has a label saying "Please Wait..."

    My objective is to show this window while the code
    executes in the server but I can not close it after i am
    done... below is a sample code....

    thanks in advance...
    jayuya

    js = "<script language=javascript>window.showModalDialog
    ('StatusDisplay.aspx','','dialogWidth=475px;dialog Height=1
    25px;status:no;help:no');</script>"

    'displays window
    RegisterStartupScript("StatusStartPage", js)
    'run code
    While minCounter <= maxCounter
    ////code to update records .....
    /////code
    minCounter = minCounter + 1 'looping to next power
    End While

    js = "<script language=javascript>window.close
    ();</script>"

    'closes window
    RegisterStartupScript("StatusEndPage", js)




    jayuya Guest

  2. Similar Questions and Discussions

    1. window not closing
      Hi, I'm using window.close() command in a pop box (YesNo.aspx) embedded in a ASP button clcik command. Its a pop up confirmation for Yes or No. If...
    2. Self Closing Pop-Up Window?
      I'm building a bunch of video samples for my website using flash movies. They open in pop-up windows but when they are done playing the window...
    3. closing pop-up window
      I have created a mail form in a pop-up window. After the mail has been send succesfull i would like the window to close (without having to click on...
    4. refresh parent window on close showModalDialog?
      Is it possible to make the parent window refresh when a modal dialog is closed? I know I can use window.opener.location.reload(true); for a...
    5. Server side Window.open?
      Ok, this has to be either easy, or impossible... I'd like to fire of a pop up window using serverside code... Basically its a preview popup of...
  3. #2

    Default Re: closing showModalDialog window from server side

    Hi jayuya,

    Take a look at:
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/dngrfwalkthroughtrackingserverprogressfromaspnetcl ientapplication.asp[/url]

    --
    Victor Garcia Aprea
    Microsoft MVP | ASP.NET
    Looking for insights on ASP.NET? Read my blog:
    [url]http://obies.com/vga/blog.aspx[/url]

    To contact me remove 'NOSPAM'. Please post all questions to the newsgroup

    and not by private mail.
    "jayuya" <jayuya@cox.net> wrote in message
    news:065601c34a80$b4dd30d0$a401280a@phx.gbl...
    > I have a simple page that I will like to display while i
    > am processing the user request in the server. The page
    > only has a label saying "Please Wait..."
    >
    > My objective is to show this window while the code
    > executes in the server but I can not close it after i am
    > done... below is a sample code....
    >
    > thanks in advance...
    > jayuya
    >
    > js = "<script language=javascript>window.showModalDialog
    > ('StatusDisplay.aspx','','dialogWidth=475px;dialog Height=1
    > 25px;status:no;help:no');</script>"
    >
    > 'displays window
    > RegisterStartupScript("StatusStartPage", js)
    > 'run code
    > While minCounter <= maxCounter
    > ////code to update records .....
    > /////code
    > minCounter = minCounter + 1 'looping to next power
    > End While
    >
    > js = "<script language=javascript>window.close
    > ();</script>"
    >
    > 'closes window
    > RegisterStartupScript("StatusEndPage", js)
    >
    >
    >
    >

    Victor Garcia Aprea [MVP] Guest

  4. #3

    Default Re: closing showModalDialog window from server side

    Hi

    Seems you are trying to close the dialog from the parent.. thats not
    possible...
    You have to close the Dialog from the dialog window and another thing the
    parent
    is blocked while this dialog is running

    maybe a regular window ( window.open ) is a better choice

    If using window.open you can poll the parent ( using
    setTimeout/setInterval) for some variable/flag and close if present
    and use <body onblur="window.focus()" .... to keep it on top

    --
    Best Regards
    Vidar Petursson
    ==============================
    Microsoft Internet Client & Controls MVP
    ==============================
    "jayuya" <jayuya@cox.net> wrote in message
    news:065601c34a80$b4dd30d0$a401280a@phx.gbl...
    > I have a simple page that I will like to display while i
    > am processing the user request in the server. The page
    > only has a label saying "Please Wait..."
    >
    > My objective is to show this window while the code
    > executes in the server but I can not close it after i am
    > done... below is a sample code....
    >
    > thanks in advance...
    > jayuya
    >
    > js = "<script language=javascript>window.showModalDialog
    > ('StatusDisplay.aspx','','dialogWidth=475px;dialog Height=1
    > 25px;status:no;help:no');</script>"
    >
    > 'displays window
    > RegisterStartupScript("StatusStartPage", js)
    > 'run code
    > While minCounter <= maxCounter
    > ////code to update records .....
    > /////code
    > minCounter = minCounter + 1 'looping to next power
    > End While
    >
    > js = "<script language=javascript>window.close
    > ();</script>"
    >
    > 'closes window
    > RegisterStartupScript("StatusEndPage", js)
    >
    >
    >
    >

    Vidar Petursson Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139