public virtual ActionResult ChangeLayout(long pageId, long layoutTemplateId) { var page = pageService.Find(pageId); if (page == null || !permissionService.IsAllowed((Int32)PageOperations.Update, this.CorePrincipal(), typeof(Page), pageId, IsPageOwner(page), PermissionOperationLevel.Object)) { throw new HttpException((int)HttpStatusCode.NotFound, Translate("Messages.NotFound")); } var pageLayoutTemplateService = ServiceLocator.Current.GetInstance <IPageLayoutTemplateService>(); PageLayoutTemplate layoutTemplate = pageLayoutTemplateService.Find(layoutTemplateId); if (layoutTemplate == null) { throw new HttpException((int)HttpStatusCode.NotFound, Translate("Messages.NotFound")); } LayoutHelper.ChangePageLayout(page, page.PageLayout.LayoutTemplate, layoutTemplate); return(PartialView(MVC.Shared.Views.Layouts.Layout, PageHelper.BindPageViewModel(page, this.CorePrincipal()))); }