Hi,
Do you have any controller which inherits from PageController<SitePageData>?
It seems to me that your Index method matches both CategoryController and the other one.
The short answer is no, but what strikes me as odd is that you can go directly to any of the sub-categories and they load up just fine. It's ONLY throwing an error on top level categories and even then ONLY when the app pool is recycled. You can refresh the page right then and there and it loads up fine and the error never appears again. It's very strange.
Just following up with some more details here, it seems like for whatever reason, when a category at the top level of our site's page is loaded, and only for the first time after IIS or the app pool is restarted, its trying to pass CategoryContentType instead of SitePageData, anyone experience this or something similar before?
Thanks!
John
Hey All,
We're using EpiServer 9.8 and getting a strange error when loading our top-level category page. What's weird about it is if you refresh the page, it works just fine and the error cannot be reproduced again until you refresh the app pool in IIS. The error we're getting is:
"The routed data is of type 'CMS.Models.Commerce.Catalog.CategoryContentType' and the binding context data 'currentPage' is of type 'CMS.Models.Commerce.Catalog.CategoryContentType', neither of which matches the requested type 'CMS.Models.Pages.SitePageData'."
Stack trace:
[TypeMismatchException: The routed data is of type 'CMS.Models.Commerce.Catalog.CategoryContentType' and the binding context data 'currentPage' is of type 'CMS.Models.Commerce.Catalog.CategoryContentType', neither of which matches the requested type 'CMS.Models.Pages.SitePageData'.]b__1e(AsyncCallback asyncCallback, Object asyncState) +445b__17(AsyncCallback asyncCallback, Object asyncState) +30b__2(AsyncCallback asyncCallback, Object asyncState) +71 > > >
EPiServer.Web.Mvc.ContentDataModelBinder.BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) +769
System.Web.Mvc.ControllerActionInvoker.GetParameterValue(ControllerContext controllerContext, ParameterDescriptor parameterDescriptor) +296
System.Web.Mvc.ControllerActionInvoker.GetParameterValues(ControllerContext controllerContext, ActionDescriptor actionDescriptor) +105
System.Web.Mvc.Async.<>c__DisplayClass25.
System.Web.Mvc.Async.WrappedAsyncResult`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +129
System.Web.Mvc.Async.AsyncControllerActionInvoker.BeginInvokeAction(ControllerContext controllerContext, String actionName, AsyncCallback callback, Object state) +302
System.Web.Mvc.<>c__DisplayClass1d.
System.Web.Mvc.Async.WrappedAsyncResult`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +129
System.Web.Mvc.Controller.BeginExecuteCore(AsyncCallback callback, Object state) +338
System.Web.Mvc.Async.WrappedAsyncResult`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +129
System.Web.Mvc.Controller.BeginExecute(RequestContext requestContext, AsyncCallback callback, Object state) +316
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.BeginExecute(RequestContext requestContext, AsyncCallback callback, Object state) +15
System.Web.Mvc.<>c__DisplayClass8.
System.Web.Mvc.Async.WrappedAsyncResult`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +129
System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +251
System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state) +48
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +16
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +103
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
And here is our code for the controller's ActionResult:
Any insight or experience with this would be greatly appreciated, we're a bit stumped.
Thanks!
John