For the rendering parameters, I have a droplist which consists of the friendly name of the CSS-class which further consists of a value field for the actual CSS-class.

In my view when I try to retrieve the rendering parameter, I am always getting a friendly name and not the actual value:

var parameter = RenderingContext.Current.Rendering.Parameters["Background"];

<div class="@parameter">

2 Answers 2


From what I understand, you're using field of a Droplist type. Droplist fields always store their values as the name of the items.

What you may want instead is a Droplink field. In the frontend value selector they look the same, but in the background they store item ID instead of item name.


You should use Droplink (as @Marek mentioned above) and extract you parameter value like:

var selectedItemId = RenderingContext.Current.Rendering.Parameters["Background"];
var selectedItem = RenderingContext.Current.ContextItem.Database.GetItem(ID.Parse(Guid.Parse(selectedItemId)));
    var parameter = selectedItem["Value"];

or the easiest way if you have Glass Mapper in your project:

var parameter = GetRenderingParameters<YourRpModel>().Value;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.