Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
I'm using Umbraco 7.1.1.I've created a Partial View with 'Register member' snippet.
How do I check if a MemberProperty is mandatory?I know Name, Email and Password are by default, but with extra custom properties it's optional.
Thanks
Onno
Hi Onno
What is your scenario? What are you trying to build? I'm not quite sure I understand your question.
Are you building a member profile page or are you building a login system? Or are you updating the member properties in some code like Razor or C#?
/Jan
Hi Jan,
I'm trying to build a login system in Razor.I created some Partial Views with snippets 'Login', 'Login status', 'Register member' and 'Edit profile'.
In the 'Register member' cshtml file their is default code like
@Html.LabelFor(m => registerModel.Email)@Html.TextBoxFor(m => registerModel.Email)@Html.ValidationMessageFor(m => registerModel.Email)
But because i'm creating this for a Dutch system I need my own layout.ValidationMessageFor in code above gives only English message.
And in the code below, I want to be able te determine if a memberproperty is Mandatory so I can place an '*' behind the label.
@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 /> }}
Thanks,
Hello Onno,
I ran into the same problem with the labels, you can solve the problem by doing something like this:
@Html.LabelFor(m => registerModel.Name, "Your Label")
Or if you want to use a dictionary value from Umbraco:
@Html.LabelFor(m => registerModel.Name, Umbraco.GetDictionaryValue("Name"))
Unfortunately i haven't quite figured out how to deal with the member properties either just yet.
// Thomas Gram
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
How to determine member type property is mandatory?
Hi,
I'm using Umbraco 7.1.1.
I've created a Partial View with 'Register member' snippet.
How do I check if a MemberProperty is mandatory?
I know Name, Email and Password are by default, but with extra custom properties it's optional.
Thanks
Onno
Hi Onno
What is your scenario? What are you trying to build? I'm not quite sure I understand your question.
Are you building a member profile page or are you building a login system? Or are you updating the member properties in some code like Razor or C#?
/Jan
Hi Jan,
I'm trying to build a login system in Razor.
I created some Partial Views with snippets 'Login', 'Login status', 'Register member' and 'Edit profile'.
In the 'Register member' cshtml file their is default code like
@Html.LabelFor(m => registerModel.Email)
@Html.TextBoxFor(m => registerModel.Email)
@Html.ValidationMessageFor(m => registerModel.Email)
But because i'm creating this for a Dutch system I need my own layout.
ValidationMessageFor in code above gives only English message.
And in the code below, I want to be able te determine if a memberproperty is Mandatory so I can place an '*' behind the label.
@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 />
}
}
Thanks,
Onno
Hello Onno,
I ran into the same problem with the labels, you can solve the problem by doing something like this:
Or if you want to use a dictionary value from Umbraco:
Unfortunately i haven't quite figured out how to deal with the member properties either just yet.
// Thomas Gram
is working on a reply...