I wrote a search page and I am getting back results. I am getting back a content page with the id of 5105 and if I go through the admin console I can see the page with the id of 5105. But for some reason I cannot get this page (or any other page by id). In cshtml I tried using
@(Umbraco.Content(5105))
And Nothing, null value is what I get.
My search service injects both UmbracoContextAccessor and UmbracoContextFactory and I leveraged EnsureContext within a using statement, same result, value is null.
When I try to get a page manually in a controller I also get null back when using
I can't seem to return any IPublishedContent.
I wrote a search page and I am getting back results. I am getting back a content page with the id of 5105 and if I go through the admin console I can see the page with the id of 5105. But for some reason I cannot get this page (or any other page by id). In cshtml I tried using
And Nothing, null value is what I get.
My search service injects both UmbracoContextAccessor and UmbracoContextFactory and I leveraged EnsureContext within a using statement, same result, value is null.
When I try to get a page manually in a controller I also get null back when using
What am I missing? This is driving me insane.
Thanks all
is working on a reply...