Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 4.5 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4.5: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-31180-6
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4.5 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old August 10th, 2015, 03:39 PM
Authorized User
Points: 150, Level: 2
Points: 150, Level: 2 Points: 150, Level: 2 Points: 150, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2014
Posts: 34
Thanks: 3
Thanked 0 Times in 0 Posts
Default Exiting a asp 4.5 app

Hi and TIA:

I am trying to exit an application from a menu link.

I have a link in my menu to "Exit Program"

that link takes the user an aspx page with a button.

when the button is clicked the following code is executed

Code:
  protected void Button1_Click(object sender, EventArgs e)
    {
        ClientScript.RegisterStartupScript(typeof(Page), "closePage", "<script type='text/JavaScript'> window.close();</script>");
    }
But this "exit page" merely reloads itself.Have tried several online solutions to no avail.

Suggestions on how to close the browser page/end this app would be greatly appreciated.

thanks,
Cliff
  #2 (permalink)  
Old August 19th, 2015, 03:17 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Cliff,

You can't close a browser with script when that script didn't create or open the window in the first place: http://stackoverflow.com/questions/1...ndow-in-chrome

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to access exiting WinMain BrianWren Pro VB 6 11 April 3rd, 2008 02:07 PM
post xml data from ASP.NET app to ASP app polekat Classic ASP Professional 2 January 31st, 2007 08:44 AM
prompt user before exiting sandeep Javascript How-To 1 September 5th, 2005 01:42 PM
A better way of exiting jaucourt VB.NET 2002/2003 Basics 1 March 31st, 2004 07:44 PM
exiting MyAccount.aspx robert BOOK: ASP.NET Website Programming Problem-Design-Solution 2 July 17th, 2003 11:23 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.