Sharepoint 2010 Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint 2010       RSS Feeds

SP2010 Custom MasterPage Code Behind

  Date: Oct 08    Category: Sharepoint 2010    Views: 1633

We have written a custom code behind for a SP2010 master page. The class is
compiled into a dll, packaged into a wsp farm solution, and deployed into the
GAC. The master page is configured to inherit from the custom code behind using
an assembly directive.

We have 2 site collections in the same web application. In one of the site
collections, the custom code behind runs fine for all users. In the other site
collection, the custom code behind runs fine for everyone except anonymous
users. I'm having trouble figuring out why.

Here's some more information:
Both site collections have identical copies of the same master page.
Both master page files are fully published and approved.
Both site collections are configured for anonymous users to have access to the
entire site



3 Answers Found

Answer #1    Answered On: Oct 08    

There are two things that may cause this:

1. You are not inheriting from the unsecuredlayoutspagebase class in
your master page code behind [1]

2. The formslockdown feature is enabled which may restrict access for
anon users [2]





Answer #2    Answered On: Oct 08    

I would suggest you have the system admin open up each set of permissions of the
various SharePoint accounts to compare one to the other. Clearly there is a
problem there, assuming all else is equal.

Answer #3    Answered On: Oct 08    

We found the problem: one site collection has output caching enabled for
anonymous users, the other does not.

Didn't find what you were looking for? Find more on SP2010 Custom MasterPage Code Behind Or get search suggestion and latest updates.