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
http://www.4GuysFromRolla.com
* When you think ASP.NET, think 4GuysFromRolla.com!