Close form

  • Thread starter Thread starter Diane Bartholow
  • Start date Start date
D

Diane Bartholow

I am going to hate myself when someone answers this. I have an asp.net form
for a quiz. I need to have a close button other than the obvious x in the
upper right. What is the syntax for closing a browser window from an asp.net
page.I am using code-behind. To use window.close do I need to import a
particular namespace?

Diane
 
<script language="JavaScript">
this.close();
</script>

If the window you are trying to close was opened by the user and not by
javascript
code, a security confirmation box will appear.
 
This eleiminates the security confirmation box:

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

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Back
Top