Re: How do I use a <asp:button> to close a window
From: Scott Mitchell [MVP] (mitchell_at_4guysfromrolla.com)
Date: 10/28/04
- Next message: Arek: "Re: Closing and refreshing windows"
- Previous message: Scott Mitchell [MVP]: "Re: Button images in DataGrid editing"
- In reply to: Ed Chiu: "How do I use a <asp:button> to close a window"
- Next in thread: Saravana: "Re: How do I use a <asp:button> to close a window"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 28 Oct 2004 16:52:24 GMT
Ed Chiu wrote:
> I would like to add a <asp:button> to a webform. When user click on this
> button, the page will connect to SQL server and update tables, then the
> browser window will be closed.
>
> I know how to connect to SQL server and update tables but I don't know how
> to close browser window after that. The SQL server part is on the server
> side, closing window is on client side.
Ed, in your Button's Click event handler, you'll have to inject some
client-side JavaScript (namely, self.close();). You can accomplish this
using the Page.RegisterClientScriptBlock() method. I discuss this
method, closing windows, and how to achieve other common client-side
techniques in ASP.NET, in this article of mine:
Working with Client-Side Script
http://tinyurl.com/3w474
Happy Programming!
--
Scott Mitchell
mitchell@4guysfromrolla.com
http://www.4GuysFromRolla.com
* When you think ASP.NET, think 4GuysFromRolla.com!
- Next message: Arek: "Re: Closing and refreshing windows"
- Previous message: Scott Mitchell [MVP]: "Re: Button images in DataGrid editing"
- In reply to: Ed Chiu: "How do I use a <asp:button> to close a window"
- Next in thread: Saravana: "Re: How do I use a <asp:button> to close a window"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|