Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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.
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
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>();
Great!
But, I might be wrong but I suspect you should be using Model.Children.OfType<Tipsandadvicearticle>();
Model.Children.OfType<Tipsandadvicearticle>();
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
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.
I'm not exactly sure where you are doing this but from the error I think you might need this
If that's not right please post more of your code.
Jeavon
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>();
Great!
But, I might be wrong but I suspect you should be using
Model.Children.OfType<Tipsandadvicearticle>();
is working on a reply...