Close a pop-window after submit is complete?

  • Thread starter Thread starter Kathy Burke
  • Start date Start date
K

Kathy Burke

I see plenty of examples of window.close javascript for a button or link
click, but I would like to do is close the pop-up window when my submit
code has completed successfully.

Any suggestions?

Thanks.

Kathy
 
Hi

Return a script to the client on post success
<script>window.close();</script>

--
Best Regards
Vidar Petursson
==============================
Microsoft Internet Client & Controls MVP
==============================
 
Vidar Petursson said:
Hi

Return a script to the client on post success
<script>window.close();</script>
Thanks, Vidar. Where do I put this exactly? Right now my submit button
is a standard asp:button that runs an onclick event.???

Kathy
 
KathyB said:
"Vidar Petursson" <[email protected]> wrote in message
Thanks, Vidar. Where do I put this exactly? Right now my submit button
is a standard asp:button that runs an onclick event.???

Kathy


In the postback server event, try putting the following:

Eg - assuming you're using VB.NET -

Sub Button1_Click(ByVal Sender As Object, ByVal E As EventArgs) Handles
Button1.Click

'Your code here

'Write script to the page to close this window
Response.Write("<script>window.close()</script>")

End Sub


Hope this helps,

Mun
 
Back
Top