Parser error : “The async attribute on the page directive is not allowed in this page”
I have seen this error on various forums for quite sometime and wondered what is that SharePoint is doing around this?
It usually happens when you add Asyc="True" attribute to a SharePoint page and try to run the page, you get Parser error "The async attribute on the page directive is not allowed in this page."
Upon further debugging and researching, found that SharePoint’s SPPageParserFilter class blocks some page directive attributes. Checked the details of the SPPageParserFilter and found that the following are the only Page attributes which allowed by SharePoint Page Parser. If you use any other attribute which is not in the list given below, SharePoint will throw exception that "The 'xxx' attribute on the page directive is not allowed in this page. "
- autoeventwireup
- buffer
- classname
- codebehind
- codepage
- compileroptions
- contenttype
- culture
- debug
- description
- enabletheming
- enableviewstate
- enableviewstatemac
- errorpage
- explicit
- inherits
- language
- lcid
- lineparagmas
- maintainscrollpositiononpostback
- masterpagefile
- responsencoding
- smartnavigation
- strict
- stylesheettheme
- targetschema
- theme
- title
- clienttarget
- uiculture
- warninglevel
Update: The highlighted 3 new entries were found in the Microsoft.SharePoint.dll for build number 12.0.6504.5000, bring the total count to 31.
As always… Happy Coding