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

Forums / Developing with Sitefinity / how to accecss event meta fields using event api?

how to accecss event meta fields using event api?

4 posts, 0 answered
  1. humayoo
    humayoo avatar
    89 posts
    Registered:
    25 Oct 2010
    17 Dec 2010
    Link to this post
    Hello,

    how to accecss event meta fields using event api ? i see the following link http://www.sitefinity.com/help/developer-manual/events-api-finding-events.html.  and this is the example .  and this is the example
    // create new instance of EventsManager
    Telerik.Events.EventsManager eventsManager = new Telerik.Events.EventsManager("Events");
    // get all events
    IList listOfAllEvents = eventsManager.GetEvents();
    if (listOfAllEvents.Count > 0)
    {
       
    foreach (Telerik.Events.IEvent eventItem in listOfAllEvents)
           Response.Write(eventItem.EventTitle +
    "<br />");
    }

    in all example they access only EventTitle . but how can we access other meta field of events like location details,contacts details etc.

    thanks
    Humayoo

    Location

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    17 Dec 2010
    Link to this post
    Hello humayoo,

    Each content item (event) has a method GetMetaData which you can use to return a value that is set for a metakey. To set a value use SetMetaData method.

    Greetings,
    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. Stephen
    Stephen avatar
    70 posts
    Registered:
    09 Jun 2009
    23 Dec 2010
    Link to this post
    IEvent does not have GetMetaData method. How can I use this method? Thanks.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    24 Dec 2010
    Link to this post
    Hello,

    Use the ContentItem property of IEvent or directly work with IContent object which is the better option for me.

    Kind regards,
    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