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
> using Examine; using System; using System.Collections.Generic; using > System.Linq; using System.Web; using System.Web.Mvc; using > Umbraco.Core.Models; using Umbraco.Web.Mvc; > > namespace ThiqahPortal.Controllers { > public class OurWorksController : Controller > { > > [HttpGet] > //[OutputCache(VaryByParam = "*", Duration = 30)] > public ActionResult getWorks(int StartIndex = 0, int PageSize = 10, string orderBy = "sortOrder", string language = "en") > { > var ids = GetWorksIDs(StartIndex, PageSize, orderBy, language); > > return PartialView("_SearchWorkList", Umbraco.TypedContent(ids)); > } > > private List<int> GetWorksIDs(int StartIndex = 0, int PageSize = 10, string orderBy = "sortOrder", string language = "en") > { > var query = string.Format("+nodeTypeAlias:ourWorksItem"); > return LuceneHelper.GetIDsByLuceneString(query, orderBy, "WebsiteSearcher").Skip(StartIndex).Take(PageSize).ToList(); > } > > } }
I have this issue on return partial view statement The variable 'contentNode' is assigned but its value is never used
Hi Rehamhabbas
Try to inherit your controller from UmbracoApiController - you will be able to use Umbraco helpers then. Read more - https://our.umbraco.org/documentation/reference/routing/webapi/
public class OurWorksController : UmbracoApiController { }
still the same error
The type or namespace name 'UmbracoApiController' could not be found (are you missing a using directive or an assembly reference?)
I inherit it from UmbracoController and it works now
Thank you so much
You are welcome, you can mark this topic as solved and have a great evening!
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
The type or namespace name 'TypedContent' does not exist in the namespace 'Umbraco' (are you missing an assembly reference?)
I have this issue on return partial view statement The variable 'contentNode' is assigned but its value is never used
Hi Rehamhabbas
Try to inherit your controller from UmbracoApiController - you will be able to use Umbraco helpers then. Read more - https://our.umbraco.org/documentation/reference/routing/webapi/
still the same error
The type or namespace name 'UmbracoApiController' could not be found (are you missing a using directive or an assembly reference?)
I inherit it from UmbracoController and it works now
Thank you so much
You are welcome, you can mark this topic as solved and have a great evening!
is working on a reply...