unload asp page

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
 
K

Kevin Spencer

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top