Using the new
var registerModel = Members.CreateRegistrationModel();
Basicall on an order confirmation page I want to allow the person to create themselves as a memeber by using the existing parameters and entering a password.
I want them to have instant access to a member group.
I can get them registered without custom properties (I'll get to that later)
But what I can't do is assing them to a group.
Is there any way to do this in the control "Register Member" which is supplied with umbraco.
Also..
In the script it itterates through custom properties. With the following.
@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 />
}
}
Hoever I want to simply fill in two fields memberFirstName and memberLastName.
I can't work out how to just edit the fields by thier alias name
Not part of this thread but never try to set the password for a member before saving the member. It wont set it otherwise. Save the member then the password.
Relevant here - Make sure you do the save password as the last data update in your code. If you have say the member group setting code after the savePassword it wont assign the member group.
Assigning Member Group on Member Creation
Been looking all over for a solution to this.
Using the new var registerModel = Members.CreateRegistrationModel();
Basicall on an order confirmation page I want to allow the person to create themselves as a memeber by using the existing parameters and entering a password.
I want them to have instant access to a member group.
I can get them registered without custom properties (I'll get to that later)
But what I can't do is assing them to a group.
Is there any way to do this in the control "Register Member" which is supplied with umbraco.
Also..
In the script it itterates through custom properties. With the following.
Hoever I want to simply fill in two fields memberFirstName and memberLastName.
I can't work out how to just edit the fields by thier alias name
LIKE...
Obvioulsy that doenst work but is there anyway to send the data directly without the form fields in the itteration.
Kind Regards
Doogie
Hi Doogie
If you have access to the MemberService
The you should be able to create a new member with
then set any custom properties using
then assign that member to a group/role using:
Then save the member:
and set their password:
and finally log them in:
if that helps give you a bit of a steer ?
https://our.umbraco.org/documentation/reference/management/services/memberservice
regards
Marc
So to take so long to reply.
Using your post I have completed the task
Thankyou very much
Doogie
Old post but something still valid.
is working on a reply...