Hello Everyone, thanks for your help in advance. This should be a simple one but I haven't gotten it to work yet. p.s. I am using Umbraco 4.7
I have a Member Type Checkbox list with the alias (facultyDepartments) where my members can check off all of the departments that they are involved in. What I want is to have the values displayed on my website like this: "Department A, Department B, Department C" but what I keep outputting is "88, 89, 92" <-- The id numbers for the checkbox items.
<umbraco:Macro runat="server" language="cshtml"> @using umbraco.cms.businesslogic.member @{ var memberId= HttpContext.Current.Request.QueryString["id"]; }
@if(memberId != null) { <!-- THIS IS THE VALUE THAT NEEDS HELP --> var departments = member.getProperty("facultyDepartments").Value.ToString();
<div id="detail">@departments</div> }
else { <!-- THUMBNAIL DISPLAY --> <!-- THIS SECTION WORKS GREAT --> var members = Member.GetAll; foreach(var item in members){ var buildingLocation = item.getProperty("facultyBuildingLocation").Value.ToString(); var roomNumber = item.getProperty("facultyRoomNumber").Value.ToString(); var facultyCV = item.getProperty("facultyCV").Value.ToString(); <!-- THIS ONE WORKS BUT IS USING item.getProperty --> @{ var departments = item.getProperty("facultyDepartments").Value.ToString(); foreach(var id in departments.Split(',')) { var memberDepartments = umbraco.library.GetPreValueAsString(Convert.ToInt32(id)); <li>@memberDepartments, </li> } }
You can see comments in my code that mention the "Thumbnail Display" everything below that works just fine.. but this second area of code is using item.getProperty instead of member.getProperty like the first one is.
How can I get the values of my checkbox list in that first section??
Output Checkbox values in Razor
Hello Everyone, thanks for your help in advance. This should be a simple one but I haven't gotten it to work yet. p.s. I am using Umbraco 4.7
I have a Member Type Checkbox list with the alias (facultyDepartments) where my members can check off all of the departments that they are involved in. What I want is to have the values displayed on my website like this: "Department A, Department B, Department C" but what I keep outputting is "88, 89, 92" <-- The id numbers for the checkbox items.
You can see comments in my code that mention the "Thumbnail Display" everything below that works just fine.. but this second area of code is using item.getProperty instead of member.getProperty like the first one is.
How can I get the values of my checkbox list in that first section??
THANK YOU!
Hi,
I'm not sure but can you try this:
Cheers,RichardWhat's wrong with de code formatting???
is working on a reply...