Closing an ASP.NET application

G

Guest

Hi all,
I have an ASP.NET application that starts up with a HTML page containing 2
frames. The top frame is an aspx page with a "Close" button. The bottom
page is an aspx page which displays some data from an Access database.

I would like to close IE by pressing the close button in the top frame,
however I have not been able to to so. I have tried a Server side button
with "Response.End()" and a Client side bytton with Javascript
"window.close()".

Any suggestions?

Mark
 
M

mortb

You don't have to do this in the code behind.
Just use client script.
I bet your problem i that you just wirte window.close() -- the frame is
considered to be a window and you can't close a frame, you'll have to close
the parent (browser) window.

I think this will work:

<script language="javascript">
function closeWindow()
{
self.parent.close();
}
</script>

<input type="button" onclick="closeWindow()" value="close">

cheers,
mortb
 
G

Guest

Thanks mortb, that worked great.

Mark

mortb said:
You don't have to do this in the code behind.
Just use client script.
I bet your problem i that you just wirte window.close() -- the frame is
considered to be a window and you can't close a frame, you'll have to close
the parent (browser) window.

I think this will work:

<script language="javascript">
function closeWindow()
{
self.parent.close();
}
</script>

<input type="button" onclick="closeWindow()" value="close">

cheers,
mortb
 

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,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top