NullReferenceException in SharePoint 2010 page layout after restore

302 Views Asked by At

It is SharePoint 2010 publishing website. I have a page layout with some user controls added to it. These users controls have rad editor controls in them. Everything was working perfectly unless one day I restored a backup from production to my dev and test environments. This page on dev and test environments started to give "System.NullReferenceException: Object reference not set to an instance of an object.". When I debug the controls are actually null, and debugger comes directly to set function for the fields, it does not call page_load function before coming to setter.

These same controls are working in other page layouts even after backup restore. The only difference I see in page layouts where these controls work and don’t work is AutoEventWireup="true". I tried adding this attribute to the page layout which is not working but SharePoint started to give error that this attribute is not allowed. Now no matter what I do, add or remove this attribute from my layout I keep getting error.

Another difference I noticed is that this layout was previously updated, other layouts were most probably never updated after website was migrated from MOSS 2007 to SharePoint 2010. The only way I can make these pages work is by removing these controls from the page,

please help me find a solution to this situation. I have already read a bunch of articles about "AutoEventWireup" I am not sure if this is the problem, nothing seems to provide a solution in my current situation.

0

There are 0 best solutions below