Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I had two FARMS. QA and PROD. Both are identical. 2 WFE / 2 APPSERVERS / 1 SQL BACKEND.

When (in QA) I browse an .aspx page it returns this error:

The attribute 'autoeventwireup' is not allowed in this page.

The same page in the other FARM (PRD) works fine. No error.


The page inside just have this:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RequestListDocumts.aspx.cs" Inherits="PMI.CMA.SitePages.UI.RequestListDocumts, PMI.CMA.SitePages.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e977370abbd36787"%>



in the web.config of this webApplication I have

<SafeMode MaxControls="200" CallStack="false" DirectFileDependencies="15" TotalFileDependencies="50" AllowPageLevelTrace="false">
  <PageParserPaths>
    <PageParserPath VirtualPath="/_catalogs/masterpage/*" CompilationMode="Always" AllowServerSideScript="true" />
  </PageParserPaths>
</SafeMode>


and this

<SafeControl Assembly="PMI.CMA.SitePages.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e977370abbd36787" Namespace="PMI.CMA.SitePages" TypeName="*" Safe="True" SafeAgainstScript="False" />

The code of this, of course, is inside a DLL registered in the GAC.

So, I had spend a week reading and digging in this problem but I didnt have any luck. Has someone had a similar issue? Or could anyone give me a hand to understand what is wrong?
I don't think is a code problem. The solution was deployed in both environment using the same version, and the same procedure using powershell scripts.


Many thanks in advance.!!! Cheers!

share|improve this question
    
I had retract and uninstall all the solutions. Then redeployed again. The same WSP is working on PRD environment and in QA still not working. I had opened a case with MS but it goes so slowly... –  Javier Aug 16 '12 at 19:32
    
Definitly is an environment configuration. But I don't know where exactly I am missing the config :( –  Javier Aug 16 '12 at 19:33
add comment

1 Answer 1

My experience (specifically with Master Pages and Page Layouts) is that the issue has 4 intertwining triggers:

  1. Master Pages or Page Layouts are customized/published to the content database
  2. Master Pages or Page Layouts utilize code behind files
  3. Master Pages or Page Layouts do have AutoEventWireup="true" in the <%@ Master %> or <%@ Page %> directive
  4. Each Master Page or Page Layout utilizing a code behind must be registered as a SafeControl

I suspect your issue starts with a master page or page layout that is customized or published to the content database in QA, but not in PROD.

The issue essentially does not occur if layouts or master pages are not published to the content database or customized in any way. If anyone has details on why this becomes an issue upon publishing, please inform.

If customization occurred, "Site Settings > Site Actions > Reset to site definition" can be used to undo all customizations, but be sure to read and consider the warning that ALL customizations will be lost.

If layouts or master pages do not require a code behind file, the corresponding AutoEventWireup, CodeBehind, Inherits, etc., attributes can be dropped off the Page/Master directive.

If the layouts or master pages do need a code behind, AutoEventWireup cannot be used, and must be removed from the layout or master. They must also have SafeControl entries for each master page or page layout utilizing a code behind (or, at least utilizing a Type wildcard for the namespace of the code behinds.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.