ImageField ImageID is all Zeros

Posted by Community Admin on 04-Aug-2018 19:25

ImageField ImageID is all Zeros

All Replies

Posted by Community Admin on 25-Aug-2011 00:00

I am adding an ImageField to a custom module that i am creating and when i try to get the Selected Image ID to store it always comes up as 00000000-0000-0000-0000-000000000000.  Am I doing something wrong here? 

<sf:ImageField ID="productImageField" runat="server" DataFieldType="Telerik.Sitefinity.Model.ContentLinks.ContentLink"
                               DisplayMode="Write" ShowDeleteImageButton="false" CssClass="sfprofileField sfprofileAvatar"/>

Posted by Community Admin on 30-Aug-2011 00:00

Hi Chris Salas,

Could you explain in more detail what do you mean by "try to get the Selected Image ID to store"?

Kind regards,
Lubomir Velkov
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Posted by Community Admin on 30-Aug-2011 00:00

productImageField.ImageId.ToString();

Sure,  i have created a module, following the testimonials example, and i want to store the ImageID from the image in the database so i can use it later. 

Posted by Community Admin on 01-Sep-2011 00:00

Hello Chris Salas,

I still do not follow. Could you please send us your entire module project so we could see what exactly is going on.

All the best,
Lubomir Velkov
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Posted by Community Admin on 30-Nov-2011 00:00

Hi,
I'm having the same issue,

<sitefinity:ImageField ID="ImageField" runat="server" DataFieldType="Telerik.Sitefinity.Model.ContentLinks.ContentLink" DisplayMode="Write" />

This allows me to select an image from the library. When I press my save button in my control, I attempt to retrieve the information about the image I just selected.
But for some reason this is 00000000-0000-0000-0000-000000000000.

Is this the wrong way to select an imagine in a Backend Module. If so what is the correct approach I should be taking.

Thanks
Martin

Posted by Community Admin on 30-Nov-2011 00:00

If you want to retrieve a GUID from the ImageField, I believe you need to set the DataFieldType to be Guid instead of ContentLink.

I talked a little about this on this blog post about using Sitefinity Fields in widgets:

Selecting Sitefinity 4 Content Inside Widget Designers


I hope this is helpful, let me know if I misunderstood your question

Posted by Community Admin on 01-Dec-2011 00:00

Cheers for the reply,
I'm trying to implement this as a Intra Module in the admin area of sitefinity.

Is it the same approach.


This thread is closed