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

Simple tabstrip in master page - null reference

8 Answers 69 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Kyle Pike
Top achievements
Rank 1
Kyle Pike asked on 20 Oct 2010, 05:40 PM
Hi,

I created a Telerik MVC Web Application from the Template
added a tabstrip to the master page
syntax is fine, it seems, but it throws a null reference exception

site.master:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<head runat="server">
    <title><asp:ContentPlaceHolder ID="TitleContent" runat="server" /></title>
    <link href="../../Content/Site.css" rel="stylesheet" type="text/css" />
<%= Html.Telerik().StyleSheetRegistrar().DefaultGroup(group => group.Add("telerik.common.css").Add("telerik.hay.css").Combined(true).Compress(true))%></head>
  
<body>
    <div class="page">
  
        <div id="header">
        </div>
  
        <div id="main">
            <div id="content">
                <% 
                Html.Telerik().TabStrip()
                .Name("SiteTabStrip")
                .Items(items =>
                 {
                     items.Add()
                         .Text("Create New")
                         .Action("xxxx", "New");
                     items.Add()
                        .Text("xxxxx")
                        .Action("xxxxx", "xxxxx");
                     items.Add()
                        .Text("xxxxx")
                        .Action("xxxx", "xxxx");
                     items.Add()
                        .Text("xxxxx")
                        .Action("xxxx", "xxxxx");
                     items.Add()
                        .Text("Documents")
                        .Action("xxxx", "Documents");
                 })
                 .Render(); 
                %>
                <asp:ContentPlaceHolder ID="MainContent" runat="server" />
            </div>
            <div id="footer">
            </div>
        </div>
    </div>
<%= Html.Telerik().ScriptRegistrar().DefaultGroup(group => group.Combined(true).Compress(true)) %></body>
</html>

error:

Object reference not set to an instance of an object. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
  
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
  
Source Error: 
  
  
Line 17:            <div id="content">
Line 18:                 <% 
Line 19:                 Html.Telerik().TabStrip()
Line 20:                 .Name("SiteTabStrip")
Line 21:                 .Items(items =>
   
  
Source File: c:\Websites\xxxxxx\xxxxxx\Views\Shared\Site.Master    Line: 19 
  
Stack Trace: 
  
  
[NullReferenceException: Object reference not set to an instance of an object.]
   Telerik.Web.Mvc.Infrastructure.Implementation.AuthorizeAttributeCache.GetAuthorizeAttributes(RequestContext requestContext, String controllerName, String actionName) +230
   Telerik.Web.Mvc.Infrastructure.Implementation.ControllerAuthorization.IsAccessibleToUser(RequestContext requestContext, String controllerName, String actionName) +171
   Telerik.Web.Mvc.Infrastructure.Implementation.NavigationItemAuthorization.IsAccessibleToUser(RequestContext requestContext, INavigatable navigationItem) +269
   Telerik.Web.Mvc.UI.NavigatableExtensions.IsAccessible(INavigatable item, INavigationItemAuthorization authorization, ViewContext viewContext) +59
   Telerik.Web.Mvc.UI.TabStrip.WriteItem(TabStripItem item, IHtmlNode parentTag, ITabStripHtmlBuilder builder) +142
   Telerik.Web.Mvc.UI.<>c__DisplayClass4.<WriteHtml>b__3(TabStripItem item) +121
   Telerik.Web.Mvc.Extensions.EnumerableExtensions.Each(IEnumerable`1 instance, Action`1 action) +230
   Telerik.Web.Mvc.UI.TabStrip.WriteHtml(HtmlTextWriter writer) +343
   Telerik.Web.Mvc.UI.ViewComponentBase.Render() +139
   Telerik.Web.Mvc.UI.ViewComponentBuilderBase`2.Render() +55
   ASP.views_shared_site_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in c:\Websites\xxxxx\xxxxx\Views\Shared\Site.Master:19
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +256
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
   System.Web.UI.Control.Render(HtmlTextWriter writer) +10
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
   System.Web.UI.Page.Render(HtmlTextWriter writer) +29
   System.Web.Mvc.ViewPage.Render(HtmlTextWriter writer) +59
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1266
  
   
  
  
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082


8 Answers, 1 is accepted

Sort by
0
Accepted
Atanas Korchev
Telerik team
answered on 21 Oct 2010, 06:50 AM
Hi Kyle Pike,

 There was a problem causing NullReferenceException if some of the tabs points to an invalid action method. Please check if this is the case.

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Kyle Pike
Top achievements
Rank 1
answered on 21 Oct 2010, 02:16 PM
OK, that worked, now i have a different problem

in IE6, clicking on a tab simply selects it. it won't click the link. i can right-click and select "Open Link" but how do i make the tabstrip function normally - so that the page is selected when the user clicks the tab?
0
Alex Gyoshev
Telerik team
answered on 21 Oct 2010, 04:14 PM
Hello Kyle,

I could not reproduce the problem that you described with our sitemap binding demo. Do you have any script bound to the tabs that may cancel the clicks, beyond the source code from your previous posts?

All the best,
Alex Gyoshev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Kyle Pike
Top achievements
Rank 1
answered on 21 Oct 2010, 05:53 PM
there is nothing at all in the code beyond that. the view is empty. the controller is empty.
i am using the updated telerik.min.js from other threads on here.
0
Kyle Pike
Top achievements
Rank 1
answered on 21 Oct 2010, 07:29 PM
i have verified that the behavior is the same in firefox 3.6.11 as well
0
Atanas Korchev
Telerik team
answered on 22 Oct 2010, 07:27 AM
Hello Kyle Pike,

 Since we cannot reproduce the problem I suggest you attach a sample project to this thread.

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Kyle Pike
Top achievements
Rank 1
answered on 22 Oct 2010, 02:06 PM
sample project attached. Bug still exists.

0
Accepted
Atanas Korchev
Telerik team
answered on 22 Oct 2010, 02:11 PM
Hi Kyle Pike,

 This is an old bug which is addressed in the Q2 2010 SP1. You can download it from this forum thread.

Greetings,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
TabStrip
Asked by
Kyle Pike
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Kyle Pike
Top achievements
Rank 1
Alex Gyoshev
Telerik team
Share this question
or