More in this section

Forums / Developing with Sitefinity / User and Event Owner

User and Event Owner

2 posts, 0 answered
  1. Praveen
    Praveen avatar
    8 posts
    23 Nov 2010
    17 Jan 2011
    Link to this post
    How to check whether user logged in is same as event owner(user created the event)
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    01 Feb 2016
    19 Jan 2011
    Link to this post
    Hello Praveen,

    You can use the bellow code to get the creator of an event item and the user name of the current user:
    EventsManager eventsManger = new EventsManager("Events");
    //EventID variable is the GUID Id of your event item
    IEvent eventItem = eventsManger.GetEvent(EventID);
    CmsContentBase contentBase = (CmsContentBase)eventItem.ContentItem;
    string creator = contentBase.Creator;
    string currentUserName = HttpContext.Current.User.Identity.Name;

    Best wishes,
    Radoslav Georgiev
    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
2 posts, 0 answered