Copied to clipboard

Flag this post as spam?

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


  • Sam 47 posts 153 karma points
    Feb 16, 2015 @ 15:55
    Sam
    0

    Umbraco 7 Register Macro Broken?

    I'm wondering if something changed in the last couple versions with regards to the Membership system and the built-in Login/Register macros?

    In looking at the Register partial view it appears as though it should be looping through any custom membership properties I created an displaying them on the form:

    @if (registerModel.MemberProperties != null)
    {
        for (var i = 0; i < registerModel.MemberProperties.Count; i++)
        {
            @Html.LabelFor(m => registerModel.MemberProperties[i].Value, registerModel.MemberProperties[i].Name)
            @* 
                By default this will render a textbox but if you want to change the editor template for this property you can easily change it. For example, if you wanted to render a custom editor for this field called "MyEditor" you would create a file at ~/Views/Shared/EditorTemplates/MyEditor.cshtml", then you will change the next line of code to render your specific editor template like:
                @Html.EditorFor(m => profileModel.MemberProperties[i].Value, "MyEditor")
            *@
            @Html.EditorFor(m => registerModel.MemberProperties[i].Value)
            @Html.HiddenFor(m => registerModel.MemberProperties[i].Alias)
            <br />
        }
    }
    

    However, it still only shows Name, Email, and Password.

    I was most likely going to customize this anyway because I want a specific order to the fields. However, I'm concerned that the custom MemberProperties are not being taken into account on the stock Register form.

  • Sam 47 posts 153 karma points
    Feb 16, 2015 @ 16:20
    Sam
    100

    Nevermind, I figured it out. I made the Register Partial Macro View part of my solution and was able to "Go To" the Members.CreateRegistrationModel definition. When I found the appropriate assembly (umbraco.dll) I loaded it up into ILSpy and viewed the source.

    There was a call to memberType.MemberCanEditProperty that was treated as a conditional when including the custom properties. I went back into the admin and noticed there was a new Member can edit column on the Info tab next to each of my custom properties. I checked the boxes, saved, and reloaded the Registration form. Sure enough, they showed up.

Please Sign in or register to post replies

Write your reply to:

Draft