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
    Nov 24, 2012 @ 20:11
    Pete
    0

    Get data from Universal Picker

    I'm using the awesome Universal Picker with the youtube datatype to show a list of videos, I can get the Id and datatypeid no problems, but not the name/title of the video chosen.

    The var @Model.MyVideo brings back DynamicXml.

    I can get the video id with:

    id = XDocument.Parse(Model.MyVideo.ToXml()).Element("value").Value;

    but for the title:

    XDocument.Parse(Model.MyVideo.ToXml()).Element("name").Value;
    XDocument.Parse(Model.MyVideo.ToXml()).Element("title").Value;

    Do not work.

    I was thinking this would access the other data, but not sure how it operates:

    XmlDocument doc = new XmlDocument();
    doc.Load(Model.MyVideo.ToXml());
    XmlNodeList rssItems = doc.SelectNodes("//item");

      foreach (XmlNode node in rssItems)
      {
          @node;
              @node["title"].InnerText;
             @node["value"].InnerText;
             @node["name"].InnerText;
      }

    Thanks.

  • Jan Skovgaard 11258 posts 23500 karma points MVP 7x admin c-trib
    Nov 25, 2012 @ 21:46
    Jan Skovgaard
    0

    Hi Pete

    Try having a look at the examples from this post http://our.umbraco.org/forum/developers/razor/27409-Consume-an-RSS-feed-in-Razor I think you should be able to achieve your goal with one of these examples.

    Hope this helps.

    /Jan

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies