Images not rendering in custom user controls
Here's the situation. I am creating a new custom control that will display Event information based on a parameter passed to it. So, I create an Event and place an image in the Description. This image is stored in the default album and the WYSIWYG editor inserted the following HTML:
<
strong
>Type your content here...</
strong
>
<
p
><
img
alt
=
""
src
=
"/images/default-album/2011/03/01/Caedmon2.jpg"
sfref
=
"[images]8c1cfdbf-72eb-4fa0-ae0f-77b6e4844d61"
/> </
p
>
<
asp:Label
ID
=
"lbDescription"
runat
=
"server"
></
asp:Label
>
private void LoadInterface(String ID)
EventsManager manager = new EventsManager();
Event eventObj = manager.GetEvent(new Guid(ID));
lbDescription.Text = eventObj.Content;
<
img
alt
=
""
src
=
"[images]8c1cfdbf-72eb-4fa0-ae0f-77b6e4844d61"
>
You can try retrieving the MediaURL to display your image. This is a good article in how to retrieve the image you are looking for www.sitefinity.com/.../modules-built-in-modules-api-media-modules-images-managing-images-finding-images.html
<
asp:Image
ID
=
"MediaURLImage1"
runat
=
"server"
/>
Telerik.Sitefinity.Libraries.Model.Image myImage =
new
Telerik.Sitefinity.Libraries.Model.Image();
MediaURLImage1.ImageUrl = myImage.MediaUrl.ToString();
Thanks for the reply! Actually, I got it. I was viewing the control in Preview mode. Once the page is published the content is rendered correctly.
Thanks again!