Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Pete 213 posts 285 karma points
    Oct 31, 2012 @ 18:19
    Pete
    0

    Get media item created date?

    All I seem to be able to get is:

    @media.Name
    @media.UpdateDate
    @media.Id

    @media.Created, @media.date, @media.createDate, @media.created don't seem to work?

    neither does media.GetProperty("created").Value.ToString();  or with any of the above variations.

    I'm on 4.9, any ideas?

    Thanks, Pete

  • Dave Woestenborghs 3504 posts 12134 karma points MVP 9x admin c-trib
    Nov 01, 2012 @ 16:31
    Dave Woestenborghs
    0

    Can you try this :

    @{
    var mediaItem = new DynamicMedia(media.Id); 
    var createDate = mediaItem.GetPropertyValue("createDate");
    }
    @createDate

    I just did this from memory so the code can contain errors

  • Pete 213 posts 285 karma points
    Nov 02, 2012 @ 12:34
    Pete
    0

    Nope, the code is sound but does'nt return anything, I've tried lots of different variations and razor does'nt return anything, but in code behind I can get the date with mediaItem.CreateDateTime using var mediaItem3 = uQuery.GetMedia(startMedia.Id);

  • Dave Woestenborghs 3504 posts 12134 karma points MVP 9x admin c-trib
    Nov 02, 2012 @ 13:15
    Dave Woestenborghs
    0

    You can use the uQuery code in Razor too so that should solve your problem.

  • Pete 213 posts 285 karma points
    Nov 02, 2012 @ 14:09
    Pete
    0

    I tried this with uQuery, it loads but does'nt return anything?

    var item2 = uQuery.GetMedia(item.id);
    @item2.getProperty("createDate");
Please Sign in or register to post replies

Write your reply to:

Draft