Hi friends,
I implemented a component with a list with products in my website built on Umbraco 12. My issue comes when i try to sort my products by price because i need a custom controller, right? So i tried to create a custom controller which inherits Surface Controller, also i created a view model like: public List
productlist {get; set;}. In my controller i tried to access my product list from CurrentPage?.Value<IEnumerable
>("productList")?.ToList(); and return Ok(vm). When i inherit my viewModel to my view, website is crashed "ModelBindingException: Cannot bind source type Umbraco.Cms.Web.Common.PublishedModels.HomePage to model type Ikea.ViewModel.Products.". Do you have any idea how to solve this issue or do you have an exemple file which implements a custom controller? More than that, how can i call my methods from controller in view? with
or what version? Thanks.