More in this section

Forums / Developing with Sitefinity / Object reference not set to an instance of an object.

Object reference not set to an instance of an object.

2 posts, 0 answered
  1. mathieu cupryk
    mathieu cupryk avatar
    9 posts
    Registered:
    20 Jul 2012
    11 Aug 2009
    Link to this post
    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 20: { Line 21: this.userName.Controls.Add(new LiteralControl(Telerik.Security.UserManager.GetCurrentUserName())); Line 22: this.projectName.Controls.Add(new LiteralControl(Telerik.Cms.Web.UrlHelper.GetProjectName())); Line 23: this.MainMenu.DataBind(); Line 24: 

    Source File: c:\svn\EnterpriseDashboard\MasterPage.master.cs    Line: 22

    Stack Trace:
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    14 Aug 2009
    Link to this post
    Hello mathieu cupryk,

    Thank you for using our services.

    Can you please give us a little bit more information on the method/event in which you are getting the error? From what I can see from the stack trace the Telerik.Cms.Web.UrlHelper.GetProjectName() method that you are calling returns a null value. Can you try to take out the initialization of the Literal Control outside, perform a check if it is null, and only then add it to the projectName control collection.

    Please, check the suggested above and get back to us. We will be more than happy to assist you.

    Greetings,
    Rado
    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
2 posts, 0 answered