Shamim
Shamim

Reputation: 383

How to use Window.OnClose

Work on C# asp.net vs05.i want when the user closes the browser window with the X in the top right corner.. i want to open a goodbye message, if the user click ok then close if click cancel then not close.

Upvotes: 0

Views: 412

Answers (1)

Himadri
Himadri

Reputation: 8876

Try the following code:

<html>
<body onUnLoad='alert("Goodbye!")'>
<h1>Hello?</h1>
</body>
</html>

Upvotes: 1

Related Questions