Howard Katz
asked on
Can the user response to the IE7 prompt when closing a window be captured?
Hello Experts,
Is there a way to trap the user response to the prompt IE7 uses when closing a window? In an asp.net application, code runs when a button is clicked. This button assumes the user presses "Yes" ( I want to close the window) If the user presses "No", I need to be able to do something else.
Thanks
Howard
Is there a way to trap the user response to the prompt IE7 uses when closing a window? In an asp.net application, code runs when a button is clicked. This button assumes the user presses "Yes" ( I want to close the window) If the user presses "No", I need to be able to do something else.
Thanks
Howard
ASKER
Thanks for your quick response....
Here is the situation. In an asp.net 2.0 application, on a master page there is a asp:button control. The onClick="btnReleaseRecord_ Click"
(see code snippet)
what I would like is that if the user selects No, then the code below
ScriptManager.RegisterClie ntScriptBl ock....New Guid().ToS tring, "window.close()", True)
does not fire.
Thanks
Here is the situation. In an asp.net 2.0 application, on a master page there is a asp:button control. The onClick="btnReleaseRecord_
(see code snippet)
what I would like is that if the user selects No, then the code below
ScriptManager.RegisterClie
does not fire.
Thanks
Protected Sub btnReleaseRecord_Click(..., ...)
ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), Guid.NewGuid().ToString, "window.close()", True)
If Session("OwnerExiting") = "yes" Then
Application.Remove(Session("QuoteNumber"))
Application.Remove(Session("QuoteNumber") & "User")
End If
Dim ow = Session("OwnerExiting")
Session.RemoveAll()
Session("OwnerExiting") = "yes"
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Forced accept.
Computer101
EE Admin
Computer101
EE Admin
<script type="text/javascript">
<!--
function doUnload()
{
//do form submission to perform an operation
formNo.submit();
}
< body onunload="doUnload()">
< /body>