Copied to clipboard

Flag this post as spam?

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


  • Amalie Wowern 144 posts 273 karma points c-trib
    Sep 21, 2015 @ 08:12
    Amalie Wowern
    0

    Use member login for member and users

    Hi

    I'm trying to make a login where both members and users can login.

    Is there a easy way to that?

    Right now i'm using the partial made by umbraco - and users can't login

    @{
    var loginModel = new LoginModel();
    
    Html.EnableClientValidation();
    Html.EnableUnobtrusiveJavaScript();
    Html.RequiresJs("/umbraco_client/ui/jquery.js");
    Html.RequiresJs("/umbraco_client/Application/JQuery/jquery.validate.min.js");
    Html.RequiresJs("/umbraco_client/Application/JQuery/jquery.validate.unobtrusive.min.js");
    }
    
    @using (Html.BeginUmbracoForm<UmbLoginController>("HandleLogin"))
    {
    <fieldset>
        <legend>Login</legend>
    
        @Html.ValidationSummary("loginModel", true)
    
        @Html.LabelFor(m => loginModel.Username)
        @Html.TextBoxFor(m => loginModel.Username)
        @Html.ValidationMessageFor(m => loginModel.Username)
        <br />
    
        @Html.LabelFor(m => loginModel.Password)
        @Html.PasswordFor(m => loginModel.Password)
        @Html.ValidationMessageFor(m => loginModel.Password)
        <br />
    
        <button>Login</button>
    </fieldset>  
    

    }

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    Sep 21, 2015 @ 10:38
    Alex Skrypnyk
    0

    Hi Amalie,

    This partial works only for members. If you want to create authentication controller for users and members, you have to make custom controller and pass data to it.

    Thanks, Alex

Please Sign in or register to post replies

Write your reply to:

Draft