Copied to clipboard

Flag this post as spam?

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


  • Aung Zin Phyo 17 posts 87 karma points
    Jan 09, 2020 @ 07:41
    Aung Zin Phyo
    0

    How to get the value of content picker property in surface controller

    How to find and get the value of umbraco contentpicker? Actually the umbraco return some digit value for that contentpicker, so iwant to convert that to display the exact value on screen How to do this?

    umb://document/53d62b4d52d2414fb0882d263cfd6e85

  • Bo Jacobsen 592 posts 2368 karma points
    Jan 09, 2020 @ 07:47
    Bo Jacobsen
    0

    Hi.

    The value you get back is a Udi. So you could do something like this in your surface controller

    using Umbraco.Web;
    
    // umb://document/53d62b4d52d2414fb0882d263cfd6e85
    var udi = CurrentPage.Value<Udi>("propertyAlias", culture);
    var document = Umbraco.Content(udi);
    
  • Aung Zin Phyo 17 posts 87 karma points
    Jan 09, 2020 @ 08:02
    Aung Zin Phyo
    0

    How I do for get data this results.

    var page = Umbraco.Content(udi);

    Simple I want to use.

    string aa = page.CarName.ToString();

    but this is error. please help me,thank.

  • Bo Jacobsen 592 posts 2368 karma points
    Jan 09, 2020 @ 08:16
    Bo Jacobsen
    0

    Then you have to use the ModelBuilder and reference the model.

    But you could also do this:

    IPublishedContent page = Umbraco.Content(udi);
    string aa = page.Value<string>("CarName");
    
  • Aung Zin Phyo 17 posts 87 karma points
    Jan 09, 2020 @ 08:22
    Aung Zin Phyo
    0

    IpublishedContent don't contain a difinication for value.

    I can't use page.Vlue(). what is wrong.

  • Bo Jacobsen 592 posts 2368 karma points
    Jan 09, 2020 @ 10:29
    Bo Jacobsen
    0

    using Umbraco.Web;

  • Aung Zin Phyo 17 posts 87 karma points
    Jan 09, 2020 @ 11:38
    Aung Zin Phyo
    0

    Umbraco.Web is disable because I am using SurfaceController.

    using Umbraco.Web.Mvc;
    

    How I do?

Please Sign in or register to post replies

Write your reply to:

Draft