How to sign out using forms authentication?

K

Keith Selbee

I want to have a logout button on my page and tried putting
FormsAuthentication.SignOut() behind it but it doesn't work. Anyone have
any ideas??



Keith
 
M

Mike McIntyre [MVP]

The call to SignOut can be followed by a Redirect to your logon.aspx page.

private void cmdSignOut_ServerClick(object sender, System.EventArgs e)
{
FormsAuthentication.SignOut();
Response.Redirect("logon.aspx", true);
}

--
Mike

Mike McIntyre
Visual Basic MVP
www.getdotnetcode.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top