This is a migrated thread and some comments may be shown as answers.

Kendo UI MVC helper not working after I add SignalR to project

1 Answer 111 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 13 Jan 2013, 08:07 PM
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)

1 Answer, 1 is accepted

Sort by
0
Accepted
Atanas Korchev
Telerik team
answered on 15 Jan 2013, 07:02 AM
Hi Scott,

 The stacktrace tells that SignalR invokes via GetRouteData
the CurrentExecutionFilePath property of the HttpRequestBase class which always throws NotImplementedException. The menu invokes GetRouteData to perform security trimming. We can't explain the behavior of SingnalrR. You can however disable security trimming of the menu to avoid this code to be invoked:

@(Html.Kendo().Menu()
              .SecurityTrimming(false)
   )


Regards,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
General Discussions
Asked by
Scott
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or