Link to home
Start Free TrialLog in
Avatar of VeeVan
VeeVan

asked on

asp:Loginview confirm before logging out

I searched for this, but couldn't find an answer.
Is there any way to prompt the user with a javascript confirm box prior to logging them out from an asp:Loginview control? I would like it to prompt them to save their work before it logs them out. (kind of like you can do on a delete in a gridview.)

Thanks in advance.
ASKER CERTIFIED SOLUTION
Avatar of Navneet Hegde
Navneet Hegde
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of VeeVan
VeeVan

ASKER

I swear I googled it. I swear. That was too easy. Thanks so much. And for future reference, I have added the code in my reply, just in case the link ends up broken.

<asp:LoginStatus ID="HeadLoginStatus" runat="server" LogoutAction="Redirect" LogoutText="Log Out" LogoutPageUrl="~/" OnClick="return confirm('Are you sure you want to Logout of the system?');" />

Open in new window