Monday, March 11, 2013

ImageProperty for EPiServer7

I’m happy to inform about a new addition to OpenWaves project. Grzegorz Wiechec – a colleague of mine at MakingWaves – contributed his first EPiServer7 property – ImageProperty.

The property enhances Url property by adding improved edit mode experience and server side scaling of images in view mode.

Getting started

To use the property add the following UIHint to any Url property.

using OpenWaves.EPiServer.ImageProperty; 


public virtual Url Image1 { get; set; }

Form editing mode

Clicking on the property opens a file browser.


Images can also be drag-dropped from the file manager.


After a picture is selected, the property shows a server-side scaled thumbnail.


On-page editing mode

In this mode the property is rendered as server-side transformed image and supports drag and drop of images from the file manager.


To enable enhanced on-page editing support, use <ow:ImageProperty> control in the page template. ImagePeoprty control is a wrapper around <EPiServer:Property> control that uses RenderSettings dictionary to pass relevant information to PropertyImageControl which in turn uses OpenWaves.ImageTransformations.Controls.Image control to enable server-side image transformations.

<ow:ImageProperty runat="server" PropertyName="Image1" 
    ImageWidth="200" ImageHeight="200" /> 

Transformation attribute can be any of the transformations supported by <ow:Image> property. See: for more details.


  1. Install OpenWaves.EPiServer.ImageProperty nugget package.
  2. Add an initializable module that registers WebImageTransformationsModule used to perform server-side image transformations.
    public class Bootstrapper : IInitializableModule 
        public void Initialize(InitializationEngine context) 
            ServiceLocator.SetResolver(new BasicResolver() 
        public void Uninitialize(InitializationEngine context) 
        { } 
        public void Preload(string[] parameters) 
        { }

Source code

Source code is available at: