Close a window after button click

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

The user clicks a buuton and the server does some
processing. If successful I want to close the window.

Any suggestions?


Steve
 
you could simply Response.Write the javascript to do a self.close() ala:

Response.Write ("<script language='javascript'>self.close();</script>")

A more elegant solution might be to use Page.RegisterStartupScript

Karl
 
Use Page.RegisterStartupScript() to add the following JavaScript to the
page:

window.opener = self;
window.close();

It will close as soon as it reloads after the PostBack.

HTH,

Kevin Spencer
Microsoft FrontPage MVP
Internet Developer
http://www.takempis.com
Big things are made up of
lots of Little things.
 
Back
Top