Update children with surfacecontroller and BeginUmbracoForm
Hi I need som help
I want to edit a list of childpages with a BeginUmbracoForm and surfacecontroller directly on a page with an edit view to a surfacecontroller
But I cant figure out how to do a list in the surfacecontroller (the list is populated from backoffice but i want to make it editable on frontend)
public class SkistatusFormController : SurfaceController
{
// GET: SkiStatusForm
[ChildActionOnly]
public ActionResult Render(Skistatus model )
{
List<SkistatusFormModel> SkistatusViewModel = new List<SkistatusFormModel>();
foreach (var item in model.Children)
{
SkistatusViewModel.Add(new SkistatusFormModel{Name = model.Name.ToString(),IsOpen = model.IsOpen});
}
return PartialView("~/Views/Partials/SiteLayout/SkistatusForm.cshtml", SkistatusViewModel);
}
}
My models
public class SkistatusFormModel
{
public string Name { get; set; }
public bool IsOpen { get; set; }
}
and a list
public class SkistatusViewModel
{
public List<Skistatus> Items { get; set; }
}
Update children with surfacecontroller and BeginUmbracoForm
Hi I need som help I want to edit a list of childpages with a BeginUmbracoForm and surfacecontroller directly on a page with an edit view to a surfacecontroller But I cant figure out how to do a list in the surfacecontroller (the list is populated from backoffice but i want to make it editable on frontend)
My models
and a list
Many thanks /Christina
is working on a reply...