Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • radnarock 7 posts 138 karma points
    Oct 28, 2015 @ 13:26
    radnarock
    0

    Render in rich text editor and the grid - Not work with Umbraco.Content().GetGridHtml

    Hello,

    I have Macro :

    @inherits Umbraco.Web.Macros.PartialViewMacroPage
    @{
        int contentId = Int32.Parse(Model.MacroParameters["ChooseContent"].ToString());
        var node = Umbraco.Content(contentId);
    }
    @node.GetGridHtml("content")
    

    ChooseContent is Content Picker, all works fine in Front Page. But if i allow to "Render in rich text editor and the grid", then i BackOffice I got :

    System.InvalidOperationException: Cannot render a macro when there is no current PublishedContentRequest.
       at Umbraco.Web.UmbracoComponentRenderer.RenderMacro(String alias, IDictionary`2 parameters)
       at Umbraco.Web.UmbracoHelper.RenderMacro(String alias, IDictionary`2 parameters)
       at ASP._Page_Views_Partials_grid_editors_macro_cshtml.Execute() in SOLUTION_DIR\Partials\Grid\Editors\Macro.cshtml:line 15
       at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
       at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
       at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
       at System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance)
       at System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer)
       at Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer)
       at System.Web.Mvc.HtmlHelper.RenderPartialInternal(String partialViewName, ViewDataDictionary viewData, Object model, TextWriter writer, ViewEngineCollection viewEngineCollection)
       at System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData)
       at System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model)
       at ASP._Page_Views_Partials_grid_editors_base_cshtml.Execute() in  SOLUTION_DIR\Views\Partials\Grid\Editors\Base.cshtml:line 20
    
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies