kentico

how to add a CSS class using a Macro expression?


I need help setting up a CSS drop-down using macro. I created a new field, and under the data type I selected the dropdown. now back under transformation i paste the new field inside the class selector, but i dont see any of the class names i typed under form control.

   <div class="alert {% AlertCssBackground %}" > <div>

Solution

  • If you stored the class name in the database field fieldName and you are using ascx page format then you can type <%# Eval("fieldName") %> in your transformation.