Copied to clipboard

Flag this post as spam?

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


  • Bilal khan 35 posts 58 karma points
    Jan 22, 2015 @ 20:26
    Bilal khan
    0

    Hybrid framework VacancyOverivewController issue

    Hi,

    I am using Hybrid framework as the base for my project. I am have a controller similar to VacancyOverviewController in Hybrib Frame work. 

     

    In the GetVacancyItem function when I am trying to get the Children of my current page using the following code.

     

    var articile = CurrentPage.Children<artilce>();

     

    I get the following error.

     

    Error 3 The property 'Umbraco.Core.Models.IPublishedContent.Children' cannot be used with type arguments

    Can anyone please help me with this?

    Many thanks in Advacnce.

    Adnan
  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Jan 22, 2015 @ 21:19
    Jeavon Leopold
    0

    I'm not exactly sure where you are doing this but from the error I think you might need this

      var articles = CurrentPage.Children.OfTypes("article")
    

    If that's not right please post more of your code.

    Jeavon

  • Bilal khan 35 posts 58 karma points
    Jan 22, 2015 @ 22:29
    Bilal khan
    1

    Thanks Jeavon the below code worked for me again your answer showed me the correct way. For anyone else trying to achieve this below is the code.

    var articles = CurrentPage.Children.OfType<Tipsandadvicearticle>();

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Jan 22, 2015 @ 23:37
    Jeavon Leopold
    0

    Great!

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Jan 22, 2015 @ 23:38
    Jeavon Leopold
    0

    But, I might be wrong but I suspect you should be using Model.Children.OfType<Tipsandadvicearticle>();

Please Sign in or register to post replies

Write your reply to:

Draft