Hi All and I hope someone can help us,
We have a website with two levels of master pages. On the bottom level
master, we use code-behind to set values for some labels such as page
title and user name. This has worked fine for months until we
converted our project into a web application. Now we are getting this
error on the first page after login (ie the first to use the master
page):

Server Error in '/' Application.
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:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace
below.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an
object.]
   SageWeb.MasterPages_ABBlogoOnly.Page_Load(Object sender, EventArgs
eEventArgs) +675
   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.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+2427
Version Information: Microsoft .NET Framework Version:2.0.50727.3074;
ASP.NET Version:2.0.50727.3601


These are the lines on the master page that seem to cause the problem
(it works fine if we comment them out):
Me.lblLoginLabel.Text = "Logged in as: " &
SageLibrary.SageUser.CurrentUserName
Me.lblLoginLabel.Visible = True
Me.lblBrowserType.Text = "Using: " &
SageLibrary.SageUser.CurrentUserBrowserType
Me.lblBrowserType.Visible = True
Me.lblScreenDetails.Text = "Screen size: " &
SageLibrary.SageUser.CurrentUserScreenWidth & " X " &
SageLibrary.SageUser.CurrentUserScreenHeight
Me.lblScreenDetails.Visible = True
Me.lblPageTitle.Visible = True
Me.lblPageTitle.Text = Me.Parent.Page.Title.ToString

In debug we have proved that all of the values called here are
available. Any idea what could be causing the problem and why the
conversion from project to web application triggered it?

Many thanks if you can help
NeilR

Reply via email to