More in this section

Forums / Developing with Sitefinity / ImageField ImageID is all Zeros

ImageField ImageID is all Zeros

7 posts, 0 answered
  1. Chris Salas
    Chris Salas avatar
    9 posts
    Registered:
    26 Oct 2009
    25 Aug 2011
    Link to this post
    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"/>
  2. Lubomir Velkov
    Lubomir Velkov avatar
    688 posts
    Registered:
    03 Nov 2014
    30 Aug 2011
    Link to this post
    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 >>

  3. Chris Salas
    Chris Salas avatar
    9 posts
    Registered:
    26 Oct 2009
    30 Aug 2011
    Link to this post
    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. 

  4. Lubomir Velkov
    Lubomir Velkov avatar
    688 posts
    Registered:
    03 Nov 2014
    01 Sep 2011
    Link to this post
    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 >>

  5. martin
    martin avatar
    36 posts
    Registered:
    30 Nov 2008
    30 Nov 2011
    Link to this post
    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
  6. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    30 Nov 2011
    Link to this post
    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
  7. martin
    martin avatar
    36 posts
    Registered:
    30 Nov 2008
    01 Dec 2011
    Link to this post
    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.


7 posts, 0 answered