How to Set the CSS Class in a Sitecore FieldRenderer

Today I was trying to set the CSS class of a Sitecore FieldRenderer tag. I tried in different ways, using the CssClass attribute, both directly in the sc:FieldRenderer tag and from the codebehind. Didn’t work. Finally I found a post that explains that the correct way is the following:

<sc:FieldRenderer runat="server" ID="myRenderer"
    Parameters="class=myCSSClass" FieldName="My Field" />
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s