Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Michael Deslongchamps 6 posts 26 karma points
    Jan 17, 2012 @ 20:39
    Michael Deslongchamps
    0

    Object reference not set to an instance of an object.

    I am getting this error on one of my home pages. I have 3 other home pages that are working fine...any thoughts?

    
    [NullReferenceException: Object reference not set to an instance of an object.]
       Enterprise.Sustainability.Web.usercontrols.RenderCSS3Homepage.NavRepeater_OnItemDataBound(Object sender, RepeaterItemEventArgs e) in C:\Projects\Enterprise\7247-Sustainability Site\7247-Sustainability Site\usercontrols\RenderCSS3Homepage.ascx.cs:192
       System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +692
       System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +67
       Enterprise.Sustainability.Web.usercontrols.RenderCSS3Homepage.Page_Load(Object sender, EventArgs e) in C:\Projects\Enterprise\7247-Sustainability Site\7247-Sustainability Site\usercontrols\RenderCSS3Homepage.ascx.cs:34
       System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +24
       System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +41
       System.Web.UI.Control.OnLoad(EventArgs e) +131
       System.Web.UI.Control.LoadRecursive() +65
       System.Web.UI.Control.LoadRecursive() +190
       System.Web.UI.Control.LoadRecursive() +190
       System.Web.UI.Control.LoadRecursive() +190
       System.Web.UI.Control.LoadRecursive() +190
       System.Web.UI.Control.LoadRecursive() +190
       System.Web.UI.Control.LoadRecursive() +190
       System.Web.UI.Control.LoadRecursive() +190
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2427
  • Lennart Stoop 304 posts 842 karma points
    Jan 17, 2012 @ 21:06
    Lennart Stoop
    0

    Looks like an error that is thrown in a custom .NET user control which has a repeater to generate a navigation and fails to do so.

    If this control is working for other pages, the issue is probably caused by data specific to this page.

    Can you try to debug the code inside the NavRepeater_OnItemDataBound method or post it here?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jan 17, 2012 @ 21:07
    Jan Skovgaard
    0

    Hi Michael

    Can you tell us a bit more about your site setup? What version of Umbraco are you experiencing this on? Has there been made some custom code like a datatype that is being used on the home node that gives you this error?

    Have you tried having a look at the umbracoLog table in the database to see if this contains any usefull information?

    /Jan

  • Michael Deslongchamps 6 posts 26 karma points
    Jan 17, 2012 @ 21:14
    Michael Deslongchamps
    0

    Log Message

    At / (Referred by: ): System.NullReferenceException: Object reference not set to an instance of an object.     at ASP.masterpages_sitemaster_master.Page_Init(Object sender, EventArgs e) in g:\WebData\drivingfutures.com\masterpages\SiteMaster.master:line 8     at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)     at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)     at System.Web.UI.Control.OnInit(EventArgs e)     at System.Web.UI.Control.InitRecursive(Control namingContainer)     at System.Web.UI.Control.InitRecursive(Control namingContainer)     at System.Web.UI.Control.InitRecursive(Control namingContainer)     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    The site is using 4.5.2

     

  • Lennart Stoop 304 posts 842 karma points
    Jan 17, 2012 @ 21:32
    Lennart Stoop
    0

    Ok, so there's a lot going on there :-)

    The easiest way to find out where the null reference is thrown is by debugging that method in Visual Studio which will only work if you have the website running on your local machine (IIS or IIS express) and attach the VS debugger. Would that work for you?

    If you can't debug it, it's going to be a bit tougher though as there are a lot of properties that could be empty or missing, or missing subpages for example. If you have a working page, you might want to cross reference for missing properties/pages in the back office.

  • Michael Deslongchamps 6 posts 26 karma points
    Jan 17, 2012 @ 21:32
    Michael Deslongchamps
    0

    I got it...i just handled the null reference error better by putting the function into a try-catch block...

Please Sign in or register to post replies

Write your reply to:

Draft