+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Can't find metafield after upgrade to SP4

Can't find metafield after upgrade to SP4

4 posts, 0 answered
  1. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    31 Jan 2011
    Link to this post
    Hi support,

    Since I can't find the option to add a support ticket for Sitefinity 3.7, I'll post my problem in the forums.
    Hopefully someone can take a look.

    I upgraded my project to the latest SP4, since I cannot update my project to SF4.0 because the lack of features for this project.

    Now I had a working custom control that shows events in a list and makes use of a different provider.
    I'm getting an error now at the following code:

    <%# Convert.ToDateTime(Eval("Event_Start")).ToString("dd-MMM-yyyy") %></em>

    The error is:
    DataBinding: 'Telerik.Cms.Engine.Data.CmsContentBase' does not contain a property with the name 'Event_Start'. 

    What could be wrong? Is the key name of this 'Event' property changed in SP4?

    Regards,
    Daniel
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    31 Jan 2011
    Link to this post
    Hi Daniel,

    Event_Start is not a property of the data collection. You can use Eval only if there is a property of the object you are binding. You can easily fix the issue by using GetMetaData method

    var date = (DateTime)content.GetMetaData("Event_Start");

    var ds = date.ToString("dd-MMM-yyyy");



    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    31 Jan 2011
    Link to this post
    Hi Ivan,

    Okay. I changed this and it works.
    I'm only not understanding why this wasn't a problem before? I'm a 100% sure this is working in SP3. Is this changed in SP4?

    Regards,
    Daniel
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    31 Jan 2011
    Link to this post
    Hello Daniel,

    I think that we have not changed anything related to the binding.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
4 posts, 0 answered