My purpose is directly show the custom popup which I want to display to the user of my website on browser/tab/window close. How to track browser/tab close? I have used onbeforeunload() method but it is showing me leave/stay message. I don't want to display that message to user. Is there any other way to track if user has hover on browser bar or browser close button ? Any help would be highly appreciated!
<div id="promocode_popup" class="popup hide" runat="server">
<p class="popupText2">Enter your email to receive Promocode</p>
<strong class="strongText">10% OFF!</strong>
<asp:TextBox ID="txtEmail" runat="server"></asp:TextBox>
<asp:LinkButton ID="btn_Submit" runat="server" OnClick="btn_Submit_OnClick" >Send Coupon!</asp:LinkButton>
</div>
<script type="text/javascript">
window.onbeforeunload = function () {
Unhide('promocode_popup');
return "hi";
};
</script>