I'm attempting to create a web part page from scratch, but I keep running into the following error, which occurs post-Init:
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.]
Microsoft.SharePoint.WebPartPages.WebPartResultSet.get_PartOrder() +77
Microsoft.SharePoint.WebPartPages.SPWebPartManager.CreateWebPartsFromRowSetData(Boolean onlyInitializeClosedWebParts) +6693
Microsoft.SharePoint.WebPartPages.SPWebPartManager.LoadWebParts() +146
Microsoft.SharePoint.WebPartPages.SPWebPartManager.OnPageInitComplete(Object sender, EventArgs e) +288
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.Page.OnInitComplete(EventArgs e) +11056990
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1674
I have tried:
- Using default.master
- Not using default.master (adding an SPWebPartManager to the page)
- Creating the page as a module of a web part
- Creating the page in the _layouts folder
- Creating the page as a component of a list definition
- Zones: Single, Multiple, None
- Web Parts: Single, Multiple, None, Inside Zones, outside Zones
- Opening an UI-created Web Part Page in Designer, copying out the contents, and pasting them into a file
- Inheriting from Microsoft.SharePoint.WebPartPages.WebPartPage
- Inheriting from a code-behind class that inherits from Microsoft.SharePoint.WebPartPages.WebPartPage
- With and without code behind
- Googling the error's source function (nothing)
- Examining the function with Reflector (apparently the WebPartResultSet is null, but I can't find why)
The Madness is calling (baa). Please help.