Object reference error when trying to view pages
I upgraded a site today from Sitefinity 4.1 to 4.1 SP1. However, now when I try to view any page (on the front-end of the site), I get an object reference error. I can edit all of the pages and templates fine in the back-end.
Anyone else having this issue?
Hi Nathan,
Have you deleted some of the templates ? The error is thrown indicates for some missing relations - one of the objects in the methods used by SitefinityPageResolver is null. SitefinityPageResolver is used exactly when you try to view a page. The problem could be related to some of the controls in your templates, since the issue occurs on all/many pages.
Greetings,
Ivan Dimitrov
the Telerik team
Hi Ivan,
Thanks for the quick response. I don't believe any templates have been removed, however, I do agree that it seems to be a problem with our master page template. There is a custom widget that we use (an image slider) and it appears to be missing. Could this be causing the reference error? Other than that, there is a login control, search, navigation and a few content blocks. They all display fine in the back-end though.
Thanks,
Nathan
Hi Nathan,
If you remove the controls from the template and add them again does this fix the issue. Are there issues creating a new page and adding some controls on it? It is possible that something went wrong during the upgrade and the old pages are only affected. I saw that you have opened a support ticket. It would be easily if you can provide FTP account or live link from where we can get the project and its database and debug it locally, so we can see the null object that is passed.
Best wishes,
Ivan Dimitrov
the Telerik team
Hi Ivan,
It seems like it occurs with any page that is using the master template. Even creating new pages (using that template) will throw the same error. The weird thing is I can edit all of the pages and preview them just fine.
I will try removing all of the controls this morning and let you know how that goes.
Nathan
Update:
It looks like if I remove every control in the template, I can get past the error. So, I guess I will need to remove all of the controls and re-add them on the actual site for it to get back to "normal".
Any ideas on why this was causing an error?
Hello Nathan,
I cannot tell you what exactly causes the issue. The main reasons for this error are - nested templates or some custom code - for instance you use a custom user control put a public properties and some of the properties are deleted which might result in an issue if you used objects based on this properties.
Kind regards,
Ivan Dimitrov
the Telerik team
Hi Ivan:
Hi Ken,
Check if the template is not based on itself. If this is the case you have to recreate it.
All the best,
Ivan Dimitrov
the Telerik team