Getting Image URL using GetValue
Hi,
How can I get the URL of an image using a custom widget?
I can get all the text field values by using:
image.GetValue("Heading").ToString()
But, not sure how I can get an image URL.
Thanks,
Gary
is image the Image model from the Images module in Sitefinity? All MediaContent items have a ItemDefaulUrl property as well as a MediaUrl and even ThumbnailUrl that you can use to access these properties directly.
If instead you're trying to get a Custom Field of type Media (image) this value is actually stored a s a GUID LINK to the image, not the image itself. I don't know if this has been improved in the recent release but if not you have to manually use this to get the media url from the guid.
There's more information and an example of this here: Retrieving Data From Dynamic Modules Using the Module Builder API
I hope this is helpful, let me know if I've misunderstood your question