Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > URL of "media selection" field type View modes: 
User avatar
Member
Member
zevinganez - 8/25/2011 5:28:45 AM
   
URL of "media selection" field type
Hi all,

I have a document type with an attibute "Image" with a field of type 'media selection'.
I'm storing it has text (attribute type).

e.g.
DB data:
Image - ~/SiteOfMad/media/Banners/banner1.png?width=223&height=146&ext=.png

I'm using the following code to show it:
<img src='<%# GetAbsoluteUrl(Eval("Image").ToString()) %>' width="223" height="146" />

Is this the correct way to do it?

Tks.

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 8/25/2011 6:45:40 AM
   
RE:URL of "media selection" field type
Hi,


it seems to be OK. Do you have any problems with this solution?


Best regards,
Helena Grulichova

User avatar
Member
Member
zevinganez - 8/25/2011 11:00:05 AM
   
RE:URL of "media selection" field type
No problems with this solution.

I was wondering if it was the right way of doing it.

On the HTML I have:
<img src='http://localhost/SiteOfMad/media/Banners/banner1.png?width=223&height=146&ext=.png' width="223" height="146" alt="Groovy baby" />

It works. Just wondering if it was the right way.

Thank you ;)
Cheers