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
Im trying to get the value that was selected in the back office, the filed is a Umbraco.DropDown which was datatype defined in the developer section
private void ContentServiceSaved(IContentService sender, Umbraco.Core.Events.SaveEventArgs<IContent> e)
var cs = new ContentService();
foreach (var myNode in e.SavedEntities.Where(x => x.HasProperty("myProperty")))
var x = myNode.GetValue("myOtherProperty");
// x ends up being a number 55 I want the drop down string value
This worked for me :-)
String selectedTextVal = umbraco.library.GetPreValueAsString(int.Parse(myNode.GetValue("myOtherProperty").ToString()));
For those trying to do this in Umbraco 7, I had the following solution. (Spread out into multiple lines for readability).
var propertyValue = myNode.getPropertyValue("myOtherProperty").ToString();
var propertyIntValue = int.Parse(propertyValue);
var selectedTextValue = Umbraco.GetPreValueAsString(propertyIntValue);
There might be a cleaner way to do it, but this gets me the desired string value for a dropdown or radio button list data type.
you could do it like this is Umbraco 7
var selectedTextValue = umbraco.library.GetPreValueAsString(myNode.getValue<int>("myOtherProperty"));
I would like to list in frontend, Dropdown prevalues added in backoffice.
I hope what you have give, is for the selected item
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted