Copied to clipboard

Flag this post as spam?

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


  • Samuel Watts 4 posts 74 karma points
    Feb 15, 2016 @ 12:52
    Samuel Watts
    0

    Register member with image upload

    Hi, new Umbraco user here. I've created a member register form using the pre-existing macros that come with the Umbraco install.

    I was wondering how would I go about placing a image upload category for my members profile picture on the register form. As I can see its using a loop to gather all the member properties but displaying them as text boxes, this includes the profile picture option.

    Any help would be appreciated.

    The code i'm using is below,

    @inherits Umbraco.Web.Macros.PartialViewMacroPage
    

    @using System.Web.Mvc.Html @using ClientDependency.Core.Mvc @using Umbraco.Web @using Umbraco.Web.Controllers

    @{ @* You can specify a custom member type alias in the constructor, the default is 'Member'
    for example, to use 'Custom Member' you'd use this syntax:

        var registerModel = Members.CreateRegistrationModel("Custom Member");
    *@
    
    var registerModel = Members.CreateRegistrationModel();
    
    @*
        Configurable here:           
    
        registerModel.RedirectUrl       - Optional. What path to redirect to if registration is successful. 
                                          By default the member will be redirected to the current umbraco page 
                                          unless this is specified.
    
        registerModel.UsernameIsEmail   - the default is true
                                          if you want the username to be different from the email
                                          address, set this to true and add a new Username field in
                                          the form below
    
                                          @Html.LabelFor(m => registerModel.Username)
                                          @Html.TextBoxFor(m => registerModel.Username)
                                          @Html.ValidationMessageFor(m => registerModel.Username)
    *@
    
    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;
    

    }

    @NOTE: This RenderJsHere code should be put on your main template page where the rest of your script tags are placed@ @Html.RenderJsHere()

    @if (success) { @* This message will show if RedirectOnSucces is set to false (default) *@

    Registration succeeeded.

    } else { using (Html.BeginUmbracoForm
  • M 40 posts 273 karma points
    Jun 22, 2017 @ 10:27
    M
    0

    Hi Sam,

    Did you figure out how to do this?

Please Sign in or register to post replies

Write your reply to:

Draft