Sitecore Image Parameters

Found a very strange behaviour with Sitecore image control,  take the following code

i would expect that would render the img tag with the correct height and width, but instead it renders out this

it overrides the height and width that i set and take the image height and width.. odd indeed

luckily we have a way to overcome this without having to use custom control or having to resort to asp.net image control – we would like the support the page editor functionality.

Set the parameters explicitly

That’s right,  we need to set the parameters explicitly so that it renders out the correct value.

First, remove the Height and Width attribute from the markup

then in the code behind

and here’s the result

Just like what i wanted.

If you’re wondering what other parameters are supported by the image control, you could find that in the Sitecore SDN

2 thoughts on “Sitecore Image Parameters

Leave a Reply

Your email address will not be published. Required fields are marked *