I converted my WebForms application to a web application, but now I am unable to use the Kendo ASP.NET MVC widgets.
I have tried to code examples, and both cause ArgumentNullExceptions to be thrown in System.Web.Routing.RouteCollection.
Here are two examples:
Similarly, calling the TabStrip code:
Results in the same exception. (The only difference it that it's TabStrip.WriteHtml instead of Menu.WriteHtml)
I have also created a new project using the "Kendo UI for MVC Web Application" template, and it works fine. So I guess there's one of the gazillion possible settings in my main project which isn't correct. But how can I figure out which one?
I've attached my Web.Config and web project file,.
I have tried to code examples, and both cause ArgumentNullExceptions to be thrown in System.Web.Routing.RouteCollection.
Here are two examples:
@(Html.Kendo().Menu().Name("menu").Items(menuItemFactory => { menuItemFactory.Add().Text("Menu Item"); }))
Results in this exception:[ArgumentNullException: Value cannot be null. Parameter name: item] System.Web.Routing.RouteCollection.SetItem(Int32 index, RouteBase item) +2340263 System.Collections.ObjectModel.Collection`1.set_Item(Int32 index, T value) +116 Kendo.Mvc.UI.NavigatableExtensions.IsCurrent(INavigatable navigatable, ViewContext viewContext, IUrlGenerator urlGenerator) +69 Kendo.Mvc.UI.Menu.HighlightSelectedItem(MenuItem item) +86 Kendo.Mvc.Extensions.EnumerableExtensions.Each(IEnumerable`1 instance, Action`1 action) +194 Kendo.Mvc.UI.Menu.WriteHtml(HtmlTextWriter writer) +202 Kendo.Mvc.UI.WidgetBase.ToHtmlString() +115 Kendo.Mvc.UI.Fluent.WidgetBuilderBase`2.ToHtmlString() +62 System.Web.HttpUtility.HtmlEncode(Object value) +38 System.Web.WebPages.WebPageBase.Write(Object value) +68 ASP._Page_Views_PlayerGroup_ScreenLayout_cshtml.Execute() in c:\Development\Development\c#\Clients\DAT Media\CMS\CMS.Website\Views\PlayerGroup\ScreenLayout.cshtml:15 System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +197
Similarly, calling the TabStrip code:
@(Html.Kendo().TabStrip()
.Name("tabStrip")
.Items(tabStrip =>
{
tabStrip.Add().Text("First").Content("First tab strip content");
tabStrip.Add().Text("Second").Content("Second tab strip content");
}
)
)
Results in the same exception. (The only difference it that it's TabStrip.WriteHtml instead of Menu.WriteHtml)
[ArgumentNullException: Value cannot be null. Parameter name: item] System.Web.Routing.RouteCollection.SetItem(Int32 index, RouteBase item) +2340263 System.Collections.ObjectModel.Collection`1.set_Item(Int32 index, T value) +116 Kendo.Mvc.UI.NavigatableExtensions.IsCurrent(INavigatable navigatable, ViewContext viewContext, IUrlGenerator urlGenerator) +69 Kendo.Mvc.UI.TabStrip.HighlightSelectedItem(TabStripItem item) +80 Kendo.Mvc.Extensions.EnumerableExtensions.Each(IEnumerable`1 instance, Action`1 action) +194 Kendo.Mvc.UI.TabStrip.WriteHtml(HtmlTextWriter writer) +294 Kendo.Mvc.UI.WidgetBase.ToHtmlString() +115 Kendo.Mvc.UI.Fluent.WidgetBuilderBase`2.ToHtmlString() +62 System.Web.HttpUtility.HtmlEncode(Object value) +38 System.Web.WebPages.WebPageBase.Write(Object value) +68 ASP._Page_Views_PlayerGroup_ScreenLayout_cshtml.Execute() in c:\Development\Development\c#\Clients\DAT Media\CMS\CMS.Website\Views\PlayerGroup\ScreenLayout.cshtml:15
I have also created a new project using the "Kendo UI for MVC Web Application" template, and it works fine. So I guess there's one of the gazillion possible settings in my main project which isn't correct. But how can I figure out which one?
I've attached my Web.Config and web project file,.