I have created a custom web part for Kentico that needs to allow the content manager to select an image from the media library that will be set as a background image in a div. The form control I am using is Media Selection. Does anyone know how I can write the aspx and c# code to display the selected image? I feel like this should be an easy answer but I am coming up short. Any help would be great!
1 Answers
0
votes
You can use MediaFileInfoProvider.GetMediaFileAbsoluteUrl() or MediaFileInfoProvider.GetMediaFileUrl() to get absolute or relative URL of the desired image and use it in aspx markup or codebehind. If you want to get "nice" URL, use example described here.