More in this section

Forums / Developing with Sitefinity / What are the different 'expressions' for Video items?

What are the different 'expressions' for Video items?

2 posts, 0 answered
  1. andersleet
    andersleet avatar
    155 posts
    03 Jun 2009
    15 Jul 2009
    Link to this post
    I am trying to work with my code-behind on a video list control and I am running into issues.  I can get the Author via the following code:

    void repeater_ItemDataBound(object sender, RepeaterItemEventArgs e) 
        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) 
            System.Text.StringBuilder sb = new System.Text.StringBuilder(); 
            Literal PostedBy = (Literal)e.Item.FindControl("litPostedBy"); 
            string Author = (string)DataBinder.Eval(e.Item.DataItem, "Author"); 
            PostedBy.Text = Author; 

    Since 'Author' is bound to a control with ID of 'Author', I figured 'PubDate' would give me the date but that returns as null. Is there a resource somewhere that I can see all the expressions available for use on this e.Item.DataItem?

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    12 Sep 2017
    16 Jul 2009
    Link to this post
    Hello andersleet,

    I suggest that you should try the code below.

        protected void Page_Load(object sender, EventArgs e) 
            this.repeater.ItemDataBound += new RepeaterItemEventHandler(repeater_ItemDataBound); 
        void repeater_ItemDataBound(object sender, RepeaterItemEventArgs e) 
            if (e.Item.ItemType == ListItemType.Item && e.Item.ItemType == ListItemType.AlternatingItem) return
            var postedBy = (Literal)e.Item.FindControl("litPostedBy"); 
            var authorControl = (Literal)e.Item.FindControl("Author"); 
            if (authorControl == null || postedBy == nullreturn
            postedBy.Text = authorControl.Text; 

    The Author is a metakey but in your code is used as a property.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
2 posts, 0 answered