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
How do I read dropdown values of a data type in Umbraco 7?
Can anyone help me out!!
thanks in advance
Hi Nathan,
This come should help you.
The ID would be the ID of the data type within Umbraco. To find this you will have to go into the data types section within Umbraco backend and click on the dropdown field. The ID can be seen in the edit url.
@using Umbraco.Core; @using Umbraco.Core.Services; @{ IDataTypeService dataTypeService = ApplicationContext.Services.DataTypeService; var prevalues = dataTypeService.GetPreValuesByDataTypeId(14950); }
Kind Regards
David
To read just one prevalue value you can use this method:
var prevalue = Umbraco.GetPreValueAsString(id);
Where id is prevalueId.
Thanks,
Alex
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Umbraco 7 How to read dropdown values
How do I read dropdown values of a data type in Umbraco 7?
Can anyone help me out!!
thanks in advance
Hi Nathan,
This come should help you.
The ID would be the ID of the data type within Umbraco. To find this you will have to go into the data types section within Umbraco backend and click on the dropdown field. The ID can be seen in the edit url.
Kind Regards
David
To read just one prevalue value you can use this method:
Where id is prevalueId.
Thanks,
Alex
is working on a reply...