I'm trying to use the DocTypeGridEditorSurfaceController. I've got the following code:
public class GridLatestNewsSurfaceController : DocTypeGridEditorSurfaceController
{
public ActionResult GridLatestNews()
{
// Do your thing...
return CurrentPartialView();
}
}
If I comment this class there are no errors. When the class is active I get the following exception:
System.Web.HttpException (0x80004005): Execution of the child request failed. Please examine the InnerException for more information. ---> System.Web.HttpException (0x80004005): The controller for path '/' was not found or does not implement IController.
at System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType)
at Umbraco.Web.Mvc.RenderControllerFactory.CreateController(RequestContext requestContext, String controllerName)
at System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory)
at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state)
at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.Wrap[TResult](Func`1 func)
at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.Wrap[TResult](Func`1 func)
at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride)
at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage)
at System.Web.HttpServerUtilityWrapper.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm)
at System.Web.Mvc.Html.ChildActionExtensions.ActionHelper(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues, TextWriter textWriter)
at System.Web.Mvc.Html.ChildActionExtensions.Action(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues)
at Our.Umbraco.DocTypeGridEditor.Web.Extensions.HtmlHelperExtensions.RenderDocTypeGridEditorItem(HtmlHelper helper, IPublishedContent content, String viewPath, String actionName, Object model)
at ASP._Page_app_plugins_doctypegrideditor_render_doctypegrideditor_cshtml.Execute() in c:\SVN\umbraco-framework\trunk\Hybrid Framework - Best Practises\development\Umbraco.Site\App_Plugins\DocTypeGridEditor\Render\DocTypeGridEditor.cshtml:line 14
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 Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer)
at System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData)
at ASP._Page_Views_Partials_grid_editors_base_cshtml.Execute() in c:\SVN\umbraco-framework\trunk\Hybrid Framework - Best Practises\development\Umbraco.Site\Views\Partials\Grid\Editors\Base.cshtml:line 20
Your controller looks correct (assuming your doctype's alias is GridLatestNews).
Unfortunately there isn't much to go on in that exception, it just seems not to be able to find the controller for some reason. Best I could suggest is check your naming, and debug in to see what it's trying to resolver as a controller and make sure it's correct.
I checked the naming serval times. If I rename the class or ActionResult to GridLatestNews2 I don't get the error. So only if the name is correct I get the error. When I debug the ActionResult never gets hit so the error seems to happen before that.
DocTypeGridEditorSurfaceController error
Hello,
I'm trying to use the DocTypeGridEditorSurfaceController. I've got the following code:
If I comment this class there are no errors. When the class is active I get the following exception:
Anyone had this before?
Jeroen
Your controller looks correct (assuming your doctype's alias is GridLatestNews).
Unfortunately there isn't much to go on in that exception, it just seems not to be able to find the controller for some reason. Best I could suggest is check your naming, and debug in to see what it's trying to resolver as a controller and make sure it's correct.
Hi Matt,
I checked the naming serval times. If I rename the class or ActionResult to GridLatestNews2 I don't get the error. So only if the name is correct I get the error. When I debug the ActionResult never gets hit so the error seems to happen before that.
Jeroen
Hi Matt,
I tried an exact copy of the example in the documentation. Did everything with the TestDocType and still getting the same error.
Do you have a working example on 0.1.1?
Jeroen
Been doing some more research. In the source of the Doc Type Grid Editor the error happens here:
https://github.com/leekelleher/umbraco-doc-type-grid-editor/blob/develop/Src/Our.Umbraco.DocTypeGridEditor/Web/Extensions/HtmlHelperExtensions.cs#L33
These are the values:
actionName -> GridLatestNews
controllerName -> GridLatestNewsSurface
And that still throws this exception:
Still don't know what's wrong exactly.
Jeroen
I solved the issue by this post:
https://our.umbraco.org/forum/getting-started/installing-umbraco/43708-The-controller-for-path-was-not-found-or-does-not-implement-IController-error-after-upgrade-from-v605-to-v613-#comment-190758
So after adding a namespace it worked :-). Next time I'll write some experimental code I'll add that first thing ;-).
is working on a reply...