Hi! I'm trying to get all the possible options in a dropdown list and put them in an enumerable variable in the front end code (.cshtml). I believe these are called prevalues? Not sure.
There was a way to do this in Umbraco 7, but I can't find how to do this in 8. Halp?
@{
var _dataTypeService = Services.DataTypeService;
var blogCategories = (DropDownFlexibleConfiguration)_dataTypeService.GetDataType(1142).Configuration;
foreach (var value in blogCategories.Items)
{
<option value="@value.Value">@value.Value</option>
}
}
Get All Possible Values in Dropdown
Hi! I'm trying to get all the possible options in a dropdown list and put them in an enumerable variable in the front end code (.cshtml). I believe these are called prevalues? Not sure.
There was a way to do this in Umbraco 7, but I can't find how to do this in 8. Halp?
Hi Kyle.
This is how I make it works :
Visual Studio wasn't smart enough to give me the namespace.
is working on a reply...