Hello,
You need to add a new property that would represent the Image selection field to the code bind. Assuming that the field added to the webpart is called Image, you can use the folling code:
public string Image
{
get
{
return ValidationHelper.GetString(this.GetValue("Image"), "");
}
set
{
this.SetValue("Image", value);
}
}
The Image selection form control stores the
NodeGUID, so you can use the
TransformationHelper.HelperObject.GetDocumentUrl method to get Url of the image and as soon as you have this Url, you can display it where you need (for example, using the asp:Image control):
string imageUrl = TransformationHelper.HelperObject.GetDocumentUrl(Image, "Image");Best regards,
Michal Legen