I have created a custom list with a custom newform. Using all OOTB SharePoint masterpages it works great. I now roll it to our test farm and it errors with a custom masterpage. The error is

The attribute 'autoeventwireup' is not allowed in this page

I've reviewed the custom master page and it actually isn't very custom. It's only custom to include a style sheet and some jquery files. As part of testing I copied the entire contents from v4.master and inserted it into the custom masterpage and it still errors.

If I remove autoeventwireup from my custom page I start getting other errors about page_load, etc. However, i don't want to remove it since it works OOTB.

Any ideas?


1 Answer 1


Resolved! Code behind doesn't appear to be allowed on the newform page. As it stands I was using a user control in the new form. So I removed the autoeventwireup and the code behind file from my newform and that worked.

  • That is strange! I have created several custom forms in 2007 with user controls that have code behind and they work great. If your user control has code it should work. Though the autoeventwireup is not required! Nov 2, 2011 at 14:55
  • yeah, it worked if my user control has code behind, but my actual page (which calls the user control) had a code behind, empty, so I removed it and it worked great. Nov 2, 2011 at 17:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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