Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Dan 1250 posts 3747 karma points admin c-trib
    Apr 16, 2010 @ 12:13
    Dan
    0

    Member log out

    Hi,

    I have the member controls package on a site, but I need visitors to be able to log out, which seems to be absent from the package.  Can anyone suggest how to create a log-out button as a macro?

    Thanks

  • skiltz 501 posts 701 karma points
    Apr 16, 2010 @ 12:28
    skiltz
    0

    You could create a usercontrol with a button that fires FormsAuthentication.Signout();

  • Base 28 posts 49 karma points
    Apr 16, 2010 @ 22:30
    Base
    0

    Or if it fits your demands you can also use the asp:LoginView, wich contain logout.

  • Base 28 posts 49 karma points
    Apr 16, 2010 @ 22:34
    Base
    0

    asp:LoginView -> asp:LoginStatus that is.

  • Dan 1250 posts 3747 karma points admin c-trib
    Apr 19, 2010 @ 11:05
    Dan
    0

    Thanks for the replies.  I've tried this, (adding the ascx and dll files to Umbraco and creating a macro) but nothing happens:

    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="memberLogOut.ascx.cs" Inherits="memberLogOut.memberLogOut" %>

    <script language="javascript" type="text/javascript">
    // <!CDATA[

    function Button1_onclick() {
    FormsAuthentication.Signout();
    }

    // ]]>
    </script>
    <p><input id="Button1" type="button" value="Log out" onclick="return Button1_onclick()" /></p>

    Can anyone point me in the right direction?

  • Dan 1250 posts 3747 karma points admin c-trib
    Apr 19, 2010 @ 11:18
    Dan
    0

    I should add... ideally I'd like to check the log-in status to make sure the user is logged in before giving them the log-out option.

  • Dan 1250 posts 3747 karma points admin c-trib
    Apr 19, 2010 @ 12:51
    Dan
    0

    Doh!  Didn't spot that the member package actually has a log-out functionality able to be built in via the macro parameters.  Sorted.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies