bahar_Agi
bahar_Agi

Reputation: 644

Get close window button in asp.net C#(server side)

I want to get the [browser] close button event in my web app. I know how to get it client side by javascript but there are some problems within. Is it possible to get this event server side in my web app?

Thanks

Upvotes: 0

Views: 2634

Answers (1)

Ted
Ted

Reputation: 4067

Can't be done through server code, but you can add some code on your server-side event which adds <script type="text\javascript">window.close();</script> when it finishes.

Have a look at ClientScriptManager.RegisterClientScriptBlock.

Upvotes: 2

Related Questions