With the code above you should get the text and not the id of the selected value in the dropdown list.
@foreach (var member in ApplicationContext.Current.Services.MemberService.GetAllMembers().OrderBy(member => member.Name)){ var branch = Umbraco.GetPreValueAsString(member.GetValue<int>("branch")); <p>@branch</p }
Getting member values from a dropdown
Hi All
Happy Monday! I am trying to get some member data from a dropdown list. The list is a list of branches whose alias is "branch" and have this code:
var branch = member.GetValue("branch");
This returns an int value and not the string value of branch which I am after. I tried:
var branch = member.GetPropertyValue
Thanks a lot.
Tony
Hi Tony
I think this will work for you.
With the code above you should get the text and not the id of the selected value in the dropdown list.
Hope this helps,
/Dennis
Hi Dennis
Genius! Thanks Dennis that worked a treat!
First the office....next the world!!
Tony
Hi Tony,
That´s nice to hear it worked, glad that I could help you.
/Dennis
is working on a reply...