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

error on Q2 2012 update

5 Answers 141 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
mahmoud
Top achievements
Rank 1
mahmoud asked on 12 Jun 2012, 06:36 AM
Dear Teleriks , 
I updated my project from  2012 Q1 to  2012 Q2 but I get the following error on  panel bar rendering. After some effort to find the source of bug , I realize the problem is with "Area" and Action in the following code : 
                  .Items(subItemAdder =>
                  {
                      subItemAdder.Add()
                          .Text("Blob blob")
                          .SpriteCssClasses("database-png")
                          .Action("Index""PriceListRows"new { Area = "PriceList" })
                  });

after removing new { Area = "PriceList" } all the things work fine! also replacing the action method with the following line has no any effect : 
   .Action("Index""PriceList/PriceListRows")

just it works fine with the following line (when the area is not set) 
   .Action("Index""PriceListRows")

what is (my) problem?

P.S : The stack trace is :

Stack Trace: 

[NullReferenceException: Object reference not set to an instance of an object.]
   Telerik.Web.Mvc.Infrastructure.Implementation.ControllerAuthorization.IsAccessibleToUser(RequestContext requestContext, String controllerName, String actionName, RouteValueDictionary routeValues) +173
   Telerik.Web.Mvc.Infrastructure.Implementation.NavigationItemAuthorization.IsAccessibleToUser(RequestContext requestContext, INavigatable navigationItem) +290
   Telerik.Web.Mvc.UI.<>c__DisplayClass2`1.<IsAccessible>b__1(T item) +76
   System.Linq.Enumerable.Any(IEnumerable`1 source, Func`2 predicate) +151
   Telerik.Web.Mvc.UI.NavigatableExtensions.IsAccessible(IEnumerable`1 items, INavigationItemAuthorization authorization, ViewContext viewContext) +267
   Telerik.Web.Mvc.UI.NavigationItemContainerExtensions.WriteItem(TItem item, TComponent component, IHtmlNode parentTag, INavigationComponentHtmlBuilder`1 builder) +1281
   Telerik.Web.Mvc.UI.<>c__DisplayClass4.<WriteHtml>b__3(PanelBarItem item) +115
   Telerik.Web.Mvc.Extensions.EnumerableExtensions.Each(IEnumerable`1 instance, Action`1 action) +200
   Telerik.Web.Mvc.UI.PanelBar.WriteHtml(HtmlTextWriter writer) +438
   Telerik.Web.Mvc.UI.ViewComponentBase.Render() +131
   ASP._Page_Views_Shared_Sections_MainMenuSection_cshtml.Execute() in d:\Projects\SAFAT\Main\Source\Safat.UI\Source\Safat.UI.Web\Views\Shared\Sections\MainMenuSection.cshtml:194
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +208
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +81
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +90
   System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +220
   System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +115
   System.Web.Mvc.HtmlHelper.RenderPartialInternal(String partialViewName, ViewDataDictionary viewData, Object model, TextWriter writer, ViewEngineCollection viewEngineCollection) +279
   System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData) +113
   System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName) +31
   ASP._Page_Views_Shared__LayoutBase_cshtml.<Execute>b__a(TextWriter __razor_template_writer) in d:\Projects\SAFAT\Main\Source\Safat.UI\Source\Safat.UI.Web\Views\Shared\_LayoutBase.cshtml:67
   System.Web.WebPages.HelperResult.WriteTo(TextWriter writer) +12
   Telerik.Web.Mvc.UI.<>c__DisplayClass7.<set_InlineTemplate>b__6(TextWriter writer) +110
   Telerik.Web.Mvc.UI.HtmlElement.WriteTo(TextWriter output) +195
   Telerik.Web.Mvc.UI.<>c__DisplayClass5.<WriteTo>b__3(IHtmlNode child) +40
   Telerik.Web.Mvc.Extensions.EnumerableExtensions.Each(IEnumerable`1 instance, Action`1 action) +200
   Telerik.Web.Mvc.UI.HtmlElement.WriteTo(TextWriter output) +315
   Telerik.Web.Mvc.UI.Splitter.WriteHtml(HtmlTextWriter writer) +74
   Telerik.Web.Mvc.UI.ViewComponentBase.ToHtmlString() +121
   Telerik.Web.Mvc.UI.ViewComponentBuilderBase`2.ToHtmlString() +56
   Telerik.Web.Mvc.UI.ViewComponentBuilderBase`2.ToString() +31
   ASP._Page_Views_Shared__LayoutBase_cshtml.<Execute>b__3(SplitterPaneFactory vPanes) in d:\Projects\SAFAT\Main\Source\Safat.UI\Source\Safat.UI.Web\Views\Shared\_LayoutBase.cshtml:49
   Telerik.Web.Mvc.UI.Fluent.SplitterBuilder.Panes(Action`1 configurePanes) +127
   ASP._Page_Views_Shared__LayoutBase_cshtml.Execute() in d:\Projects\SAFAT\Main\Source\Safat.UI\Source\Safat.UI.Web\Views\Shared\_LayoutBase.cshtml:22
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +208
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +81
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +90
   System.Web.WebPages.<>c__DisplayClass7.<RenderPageCore>b__6(TextWriter writer) +103
   System.Web.WebPages.HelperResult.WriteTo(TextWriter writer) +12
   System.Web.WebPages.WebPageBase.Write(HelperResult result) +67
   System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body) +66
   System.Web.WebPages.WebPageBase.PopContext() +261
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +98
   System.Web.WebPages.<>c__DisplayClass7.<RenderPageCore>b__6(TextWriter writer) +103
   System.Web.WebPages.HelperResult.WriteTo(TextWriter writer) +12
   System.Web.WebPages.WebPageBase.Write(HelperResult result) +67
   System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body) +66
   System.Web.WebPages.WebPageBase.PopContext() +261
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +98
   System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +220
   System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +115
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +303
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +13
   System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +23
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +177
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +343
   System.Web.Mvc.Controller.ExecuteCore() +116
   System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +97
   System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
   System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +37
   System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +21
   System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +12
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
   System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +50
   System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7
   System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8970061
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184

5 Answers, 1 is accepted

Sort by
0
Sergio
Top achievements
Rank 1
answered on 15 Jun 2012, 08:25 AM
Hello, I got a similar problem with menu. Can't post code now, but the stacktrace is similar. 

I'm not using areas, only actions.

I had to revert the update :/
0
Jacek
Top achievements
Rank 1
answered on 18 Jun 2012, 01:12 PM
sergio, I am not sure if it helps. But I just fixed an issue in my code which also worked fine and ceased to work after an upgrade to 2012.2. The problem was with Action/Controller value for non-leaf nodes that do not generate links to actions. As such their controller/action values were ignored in previous version but now they need to point to correct action (otherwise IsAccessibleToUser method fails). By commenting out individual nodes I found out which node is responsible for this error message and fixed Action value.

Unfortunately mahmoud's issue is related to areas so this solution probably would not apply.
0
eric
Top achievements
Rank 1
answered on 21 Jun 2012, 07:44 PM
I have the same issue. I upgraded and now my menu does not load my sitemap. Telerik? Fix?
0
Sergio
Top achievements
Rank 1
answered on 22 Jun 2012, 06:22 AM
Hello again, as Jacek said the problem is that I got "non leaf" nodes that doesn't got actions. But I don't need actions in that nodes. Is there any "null/empty" action that could I use to link that nodes? 

Thank you.

0
Hieu
Top achievements
Rank 1
answered on 29 Jun 2012, 07:02 AM
 
subItemAdder.Add()
.Url(Url.Action("actionName", "controllerName"))
 .Text("displayName");
Tags
General Discussions
Asked by
mahmoud
Top achievements
Rank 1
Answers by
Sergio
Top achievements
Rank 1
Jacek
Top achievements
Rank 1
eric
Top achievements
Rank 1
Hieu
Top achievements
Rank 1
Share this question
or