Getting image url of CMSEditableImage in webpart code

Oakwood Admin asked on February 16, 2017 10:45

I need to get the url of the image in code-behind because I need to use as a background image. .ImageControl is always null.

There is some code here (https://devnet.kentico.com/questions/retrieve-image-url-from-cms-cmseditableimage-in-code) but this relates to to an ASPX page, not a web-part and it doesn't work.

Recent Answers


Roman Hutnyk answered on February 16, 2017 11:05

I'd recommend removing editable image from a page template, but adding appropriate field to a page type, so content editor still can add/upload an image and you use it the way you need. Editable image is not intended to be a background.

0 votesVote for this answer Mark as a Correct answer

Oakwood Admin answered on February 16, 2017 11:09

Its a web-part if that makes any difference (ultimately used as a widget)? My only other fields are text areas, so i wouldn't want the user to have to go in and configure widget just to select an image.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.