I have been using Kendo UI controls such as menu and grid in my current project. I wanted to add some additional real time functionality using SignalR. However, after I add the following code to my Global.asax.cs file, which enables routing for SignalR, I get run-time errors on my Kendo UI markup. I hope someone can help, as I am stumped and have spent a ton of time on this already.
Here is the code that I add to my Global.asax.cs in the Application_Start():
RouteTable.Routes.MapHubs();
Here is my markup for the first Kendo UI menu control in my _Layout.cshtml file, which works fine until I add the line above:
@(Html.Kendo().Menu()
.Name("topLevelMenu")
.Items(items =>
{
items.Add().Text("CRM").Action("Index", "Crm").ImageUrl("~/Images/group.png").LinkHtmlAttributes(new {id = "btnCrm"});
items.Add().Text("Accounting").Action("Index", "Accounting").ImageUrl("~/Images/coins.png");
items.Add().Text("Inventory").Action("Index", "Inventory").ImageUrl("~/Images/table.png");
items.Add().Text("Daily Service").Action("RepairOrdersCalendar", "DailyService").ImageUrl("~/Images/calendar.png");
})
)
The error I get is a NotImplementedException. Here is the stack trace:
at System.Web.HttpRequestBase.get_CurrentExecutionFilePath()
at Microsoft.Owin.Host.SystemWeb.OwinRoute.GetRouteData(HttpContextBase httpContext)
at System.Web.Routing.RouteCollection.GetRouteData(HttpContextBase httpContext)
at Kendo.Mvc.Infrastructure.Implementation.AuthorizationContextCache.GetAuthorizationContext(RequestContext request, String controllerName, String actionName, RouteValueDictionary routeValues)
at Kendo.Mvc.Infrastructure.Implementation.ControllerAuthorization.IsAccessibleToUser(RequestContext requestContext, String controllerName, String actionName, RouteValueDictionary routeValues)
at Kendo.Mvc.Infrastructure.Implementation.NavigationItemAuthorization.IsAccessibleToUser(RequestContext requestContext, INavigatable navigationItem)
at Kendo.Mvc.UI.NavigationItemContainerExtensions.WriteItem[TComponent,TItem](TItem item, TComponent component, IHtmlNode parentTag, INavigationComponentHtmlBuilder`1 builder)
at Kendo.Mvc.UI.Menu.<WriteHtml>c__AnonStorey73.<>m__21C(MenuItem item)
at Kendo.Mvc.Extensions.EnumerableExtensions.Each[T](IEnumerable`1 instance, Action`1 action)
at Kendo.Mvc.UI.Menu.WriteHtml(HtmlTextWriter writer)
at Kendo.Mvc.UI.WidgetBase.ToHtmlString()
at Kendo.Mvc.UI.Fluent.WidgetBuilderBase`2.ToHtmlString()
at System.Web.WebPages.WebPageExecutingBase.WriteTo(TextWriter writer, Object content)
at ASP._Page_Views_Shared__Layout_cshtml.Execute() in c:\Development\TrishullaErp\Trishulla.Erp.Web.Core.Main\Views\Shared\_Layout.cshtml:line 57
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.WebPages.WebPageBase.Write(HelperResult result)
at System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body)
at System.Web.WebPages.WebPageBase.PopContext()
at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1a.<InvokeActionResultWithFilters>b__17()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)
Here is the code that I add to my Global.asax.cs in the Application_Start():
RouteTable.Routes.MapHubs();
Here is my markup for the first Kendo UI menu control in my _Layout.cshtml file, which works fine until I add the line above:
@(Html.Kendo().Menu()
.Name("topLevelMenu")
.Items(items =>
{
items.Add().Text("CRM").Action("Index", "Crm").ImageUrl("~/Images/group.png").LinkHtmlAttributes(new {id = "btnCrm"});
items.Add().Text("Accounting").Action("Index", "Accounting").ImageUrl("~/Images/coins.png");
items.Add().Text("Inventory").Action("Index", "Inventory").ImageUrl("~/Images/table.png");
items.Add().Text("Daily Service").Action("RepairOrdersCalendar", "DailyService").ImageUrl("~/Images/calendar.png");
})
)
The error I get is a NotImplementedException. Here is the stack trace:
at System.Web.HttpRequestBase.get_CurrentExecutionFilePath()
at Microsoft.Owin.Host.SystemWeb.OwinRoute.GetRouteData(HttpContextBase httpContext)
at System.Web.Routing.RouteCollection.GetRouteData(HttpContextBase httpContext)
at Kendo.Mvc.Infrastructure.Implementation.AuthorizationContextCache.GetAuthorizationContext(RequestContext request, String controllerName, String actionName, RouteValueDictionary routeValues)
at Kendo.Mvc.Infrastructure.Implementation.ControllerAuthorization.IsAccessibleToUser(RequestContext requestContext, String controllerName, String actionName, RouteValueDictionary routeValues)
at Kendo.Mvc.Infrastructure.Implementation.NavigationItemAuthorization.IsAccessibleToUser(RequestContext requestContext, INavigatable navigationItem)
at Kendo.Mvc.UI.NavigationItemContainerExtensions.WriteItem[TComponent,TItem](TItem item, TComponent component, IHtmlNode parentTag, INavigationComponentHtmlBuilder`1 builder)
at Kendo.Mvc.UI.Menu.<WriteHtml>c__AnonStorey73.<>m__21C(MenuItem item)
at Kendo.Mvc.Extensions.EnumerableExtensions.Each[T](IEnumerable`1 instance, Action`1 action)
at Kendo.Mvc.UI.Menu.WriteHtml(HtmlTextWriter writer)
at Kendo.Mvc.UI.WidgetBase.ToHtmlString()
at Kendo.Mvc.UI.Fluent.WidgetBuilderBase`2.ToHtmlString()
at System.Web.WebPages.WebPageExecutingBase.WriteTo(TextWriter writer, Object content)
at ASP._Page_Views_Shared__Layout_cshtml.Execute() in c:\Development\TrishullaErp\Trishulla.Erp.Web.Core.Main\Views\Shared\_Layout.cshtml:line 57
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.WebPages.WebPageBase.Write(HelperResult result)
at System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body)
at System.Web.WebPages.WebPageBase.PopContext()
at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1a.<InvokeActionResultWithFilters>b__17()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)