Default.aspx.cs throw System.NullReferenceException.

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
6/12/2007 7:52:28 PM
Gravatar
Total Posts 3

Default.aspx.cs throw System.NullReferenceException.

My computer is very slow.

When I access http://localhost/mojoportal,the application begin to be compiled.But the process is very slow.

Then it can throw System.NullReferenceException.And I refresh the page ,no exception is threw.

Default.aspx.cs

private void LoadPage()
{
EnsurePageAndSite();
if (CurrentPage == null) return;
LoadSettings();
EnforceSecuritySettings();
SetupAdminLinks();

if ((CurrentPage.ShowChildPageMenu)
|| (CurrentPage.ShowBreadcrumbs)
|| (CurrentPage.ShowChildPageBreadcrumbs)
)
{
this.MPContent.Visible = true;
this.MPContent.Parent.Visible = true;
}

if (CurrentPage.Modules.Count > 0)
{
foreach (Module module in CurrentPage.Modules)
{
Control parent;
switch (module.PaneName.ToLower())
{
case "leftpane":
parent = this.MPLeftPane;
break;
case "rightpane":
parent = this.MPRightPane;
break;
case "contentpane":
default:
parent = this.MPContent;
break;
}

if (module.CacheTime == 0)
{
SiteModuleControl siteModule = (SiteModuleControl)Page.LoadControl(module.ControlSource);

siteModule.SiteID = siteSettings.SiteID;
siteModule.ModuleConfiguration = module;
parent.Controls.Add(siteModule);
}
else
{
CachedSiteModuleControl siteModule = new CachedSiteModuleControl();

siteModule.SiteID = siteSettings.SiteID;//here it is possible that siteSetting is null
siteModule.ModuleConfiguration = module;
parent.Controls.Add(siteModule);
}

parent.Controls.Add(new LiteralControl("<br />"));
parent.Visible = true;
parent.Parent.Visible = true;
}
}
}

6/13/2007 6:51:32 AM
Gravatar
Total Posts 18439

Re: Default.aspx.cs throw System.NullReferenceException.

Hi,

siteSettings should not be null there and cannot be null there and work correctly. If it is null there then would need to figure out why that is happening and solve the underlying problem.

SiteSettings is cached so it does not have to be built on each request.

If the machine doesn't have enough memory or has a very slow connection to the db then it is likely to raise errors. db timeouts willl cause errors in any web app.

Joe

You must sign in to post in the forums. This thread is closed to new posts.