I am trying to render a template but is stuck with this error:
<!-- Error rendering template with id 1080: 'System.ArgumentNullException: Value cannot be null.Parameter name: controller at System.Web.Mvc.ControllerContext..ctor(RequestContext requestContext, ControllerBase controller) at Umbraco.Web.Templates.TemplateRenderer.ExecuteTemplateRendering(TextWriter sw, PublishedContentRequest contentRequest) at Umbraco.Web.Templates.TemplateRenderer.Render(StringWriter writer) at Umbraco.Web.UmbracoHelper.RenderTemplate(Int32 pageId, Nullable`1 altTemplateId)' -->
The ID is correct, and I am trying to render it using this:
@Umbraco.RenderTemplate(1080)
The DocType is ContentWidget and I have a ContentWidgetController (have tried with both a SurfaceController and ordinary Controller).
From dotpeek I have discovered that this property is null: umbracoRouteDefinition.Controller
Same here. I have a module that does some checks and returns the html of some arbitrary node. Currently I am using the application.PreRequestHandlerExecute event to do the checks. Could it be that some MVC plumbing is not in place yet during this event?
Though ugly I might have to go with @Razvan's solution for the time being...don't like internal request though.
Error rendering template (missing controller)
Hi there,
I am trying to render a template but is stuck with this error:
<!-- Error rendering template with id 1080: 'System.ArgumentNullException: Value cannot be null.Parameter name: controller at System.Web.Mvc.ControllerContext..ctor(RequestContext requestContext, ControllerBase controller) at Umbraco.Web.Templates.TemplateRenderer.ExecuteTemplateRendering(TextWriter sw, PublishedContentRequest contentRequest) at Umbraco.Web.Templates.TemplateRenderer.Render(StringWriter writer) at Umbraco.Web.UmbracoHelper.RenderTemplate(Int32 pageId, Nullable`1 altTemplateId)' -->
The ID is correct, and I am trying to render it using this:
@Umbraco.RenderTemplate(1080)
The DocType is ContentWidget and I have a ContentWidgetController (have tried with both a SurfaceController and ordinary Controller).
From dotpeek I have discovered that this property is null:
umbracoRouteDefinition.Controller
Any help would be greatly appreciated :-)
Thanks in advance!
I just experienced the same issue with Umbraco 6.1.1.
Suggested solution is to use @Html.Partial instead: http://issues.umbraco.org/issue/U4-1174#comment=67-3664
Thanks alot - it's working like a charm!
I have the same problem, but the above solution does not work for me because I need to render the page in code (not in views/template).
The ugly solution for me was to download the page
Same here. I have a module that does some checks and returns the html of some arbitrary node. Currently I am using the application.PreRequestHandlerExecute event to do the checks. Could it be that some MVC plumbing is not in place yet during this event?
Though ugly I might have to go with @Razvan's solution for the time being...don't like internal request though.
S
is working on a reply...