Copied to clipboard

Flag this post as spam?

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


  • Fernando Porrino 6 posts 46 karma points
    Mar 28, 2014 @ 19:22
    Fernando Porrino
    0

    Register custom type member

    Hi there!

    I'm trying to register a new custom type member using the Register Partial View that comes with Umbraco 7.1 (beta), this is the code that I used:

    @{        
    var registerModel = Members.CreateRegistrationModel("Propietario");
    
    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");
    
    var success = TempData["FormSuccess"] != null;
    }
    
    @if (success) 
    { 
        <p>Registration succeeeded.</p>
    } 
    else 
    { 
    
    using (Html.BeginUmbracoForm<UmbRegisterController>("HandleRegisterMember"))
    {
        <fieldset>
            <legend>Registrar @registerModel.MemberTypeAlias</legend>
    
            @Html.ValidationSummary(true)
    
            @Html.LabelFor(m => registerModel.Name)
            @Html.TextBoxFor(m => registerModel.Name)
            @Html.ValidationMessageFor(m => registerModel.Name)
            <br />
    
            @Html.LabelFor(m => registerModel.Email)
            @Html.TextBoxFor(m => registerModel.Email)
            @Html.ValidationMessageFor(m => registerModel.Email)
            <br />
    
            @Html.LabelFor(m => registerModel.Password)
            @Html.PasswordFor(m => registerModel.Password)
            @Html.ValidationMessageFor(m => registerModel.Password)
            <br />
    
            @if (registerModel.MemberProperties != null) { 
                for (var i = 0; i < registerModel.MemberProperties.Count; i++)
                {
                    @Html.LabelFor(m => registerModel.MemberProperties[i].Value, registerModel.MemberProperties[i].Name)
                    @Html.EditorFor(m => registerModel.MemberProperties[i].Value)
                    @Html.HiddenFor(m => registerModel.MemberProperties[i].Alias)
                    <br />
                }
            }
    
            @Html.HiddenFor(m => registerModel.MemberTypeAlias)
            @Html.HiddenFor(m => registerModel.RedirectUrl)      
            @Html.HiddenFor(m => registerModel.UsernameIsEmail)
    
            <button>Register</button>
        </fieldset>  
    
        @Html.RenderJsHere()
    
       }
    }
    

    Of course I created the new member type in the backoffice with exactly the same Name and Alias (capital letters included). The code works fine except for one detail: the new generated member is of "member" type and not "Propietario"...

    I have been working for hours, following examples, looking at the forum but nothing... I can't make it work :'(

    Thanks a lot for your help.

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Mar 28, 2014 @ 22:37
    Jeroen Breuer
    0

    Hello,

    You only pasted the code of the form, but not the HandleRegisterMember where the member is created. Maybe something goes wrong in there. Are you using the new member API? http://issues.umbraco.org/issue/U4-1659

    Jeroen

  • Fernando Porrino 6 posts 46 karma points
    Mar 28, 2014 @ 23:06
    Fernando Porrino
    0

    Hi,

    I have been looking for the piece of code where the member is created but i haven't found it... I guess is the standard that Umbraco uses but i don't know if it's inside a dll or not. Do you know where the Umbraco's standard HandleRegisterMember is? It's the first time that I work with members so i'm a bit noob in this area :p

    Thanks :)

  • Patrick Livbom 6 posts 27 karma points
    Apr 08, 2014 @ 09:35
    Patrick Livbom
    0

    I am also looking for some guidance to get forward with this. I am also in the awkward position that i dont know how to render a checkboxlist from a members custom property into the razor registermember cshtml file. Any help appreciated. :)

  • Mark Regan 2 posts -20 karma points
    Apr 29, 2014 @ 16:23
    Mark Regan
    0

    Did anyone get to the bottom of this? I have a slightly different issue and wondering if they are connected. Documentation on this are is not great.

  • Fernando Porrino 6 posts 46 karma points
    Apr 29, 2014 @ 16:26
    Fernando Porrino
    0

    Hi folks.

    I finally abandoned this approach and decided not to use Umbraco for this project (but I'm still using it for other ones and I love it :p )

Please Sign in or register to post replies

Write your reply to:

Draft