Copied to clipboard

Flag this post as spam?

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


  • SinkyPars 132 posts 175 karma points
    Sep 17, 2012 @ 19:01
    SinkyPars
    0

    .Net Usercontrols with ValidationSummary

    Hi,

    I am having real trouble getting a usercontrol macro to work whilst placed via the RTE and rendered using umbraco.library:RenderMacroContent. The problem only seems to be when I include a ValidationSummary control within the usercontrol. Here is the error I get on render:

    <!-- Error generating macroContent: 'System.NullReferenceException: Object reference not set to an instance of an object.

       at System.Web.UI.WebControls.ValidationSummary.GetErrorMessages(Boolean& inError)

       at System.Web.UI.WebControls.ValidationSummary.Render(HtmlTextWriter writer)

       at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)

       at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)

       at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)

       at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)

       at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)

       at System.Web.UI.Control.Render(HtmlTextWriter writer)

       at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)

       at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)

       at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)

       at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)

       at umbraco.presentation.templateControls.Macro.Render(HtmlTextWriter writer)

       at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)

       at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)

       at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)

       at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)

       at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)

       at System.Web.UI.Control.Render(HtmlTextWriter writer)

       at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)

       at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)

       at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)

       at umbraco.library.RenderMacroContent(String Text, Int32 PageId)' -->

    I have no problem including this macro via a template :S

    Any help is much appreciated.

     

    Scott

     

     

     

  • SinkyPars 132 posts 175 karma points
    Sep 17, 2012 @ 19:01
    SinkyPars
    0

    I should also mention I am on v4.9.

    Cheers

     

    S

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Sep 17, 2012 @ 19:08
    Tom Fulton
    0

    Hi Scott,

    Unfortunately I don't think RenderMacroContent works well with usercontrols that contain any server-side forms.  You'd have to output the content in the template for it to work properly -- or use a Razor macro or other solution.

    http://our.umbraco.org/forum/developers/xslt/2872-RenderMacroContent-problem

    Sorry there's not better news!

    Tom 

Please Sign in or register to post replies

Write your reply to:

Draft