Closing an ASP.NET application

Discussion in 'ASP .Net' started by =?Utf-8?B?Uk1M?=, Aug 11, 2004.

  1. 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
     
    =?Utf-8?B?Uk1M?=, Aug 11, 2004
    #1
    1. Advertising

  2. =?Utf-8?B?Uk1M?=

    mortb Guest

    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

    "RML" <> wrote in message
    news:...
    > 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
    >
     
    mortb, Aug 11, 2004
    #2
    1. Advertising

  3. Thanks mortb, that worked great.

    Mark

    "mortb" wrote:

    > 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
    >
    > "RML" <> wrote in message
    > news:...
    > > 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
    > >

    >
    >
    >
     
    =?Utf-8?B?Uk1M?=, Aug 12, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hillary Hill
    Replies:
    2
    Views:
    541
    Hillary Hill
    May 13, 2005
  2. Ameen
    Replies:
    3
    Views:
    3,400
    Ameen
    Oct 18, 2005
  3. federico

    closing excel application

    federico, Oct 17, 2003, in forum: Python
    Replies:
    4
    Views:
    629
    federico
    Oct 20, 2003
  4. =?Utf-8?B?Vk1J?=

    Closing popup window when closing parent window?

    =?Utf-8?B?Vk1J?=, Feb 14, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    682
    Thomas Hansen
    Feb 15, 2007
  5. thomas
    Replies:
    0
    Views:
    256
    thomas
    Oct 23, 2003
Loading...

Share This Page