I spent hours trying to figure out how to set the class attribute of images rendered with the Sitecore FieldRenderer. Unfortunately, the CssClass attribute does not work on the FieldRenderer control as it does on the Image WebControl. Long after I had given up and resigned to use <asp:Image>, my colleague figured out a workaround. Until there is a better solution, I’ll use this:
1 2 |
<sc:FieldRenderer runat="server" ID="frFirstListImage" Parameters="class=imageLeft" FieldName="Image Field" /> |