unload asp page

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Provided is some basic code VB.Net for applications, but I am trying to find
the best method to destroy an asp page, similar to EXIT if i were to go to IE
press File and EXIT. Does anyone know how to do that in ASP.NET with VB
code?

Unload Me 'does not work either
WebForm1.Exit() 'also does not do the trick either
 
Thank God you asked your question when you did. Do you realize all of the
possible combinations of imagined syntax that you could have tried? ;-)

There are 2 components to an ASP.Net application: Server-side classes and
code, and client-side HTML. When a Request is received by the web server,
the HTML doesn't exist. ASP.Net has to build it. Therefore, there is simply
no way on the server to close the browser window. It has to be done using
JavaScript on the client, which you can certainly add to the Page while it
is processing on the server. The following client-side JavaScript will work:

<script type="text/javascript"><!--
window.opener = self; window.close();
// --></script>

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