While migrating Custom aspx pages from MOSS 2007 to SP 2010, below mentioned pages directives are to be modified accordingly.
MOSS way of doing
<%@ Page Language="C#" Inherits="Microsoft.SharePoint.ApplicationPages.NewListPage" MasterPageFile="~/_layouts/application_Custom.master" %>
SP 2010 way of declaring the directive,
<%@ Page language="C#"
MasterPageFile= "~/_layouts/app lication_Custom.master"
Inherits="Micro soft.SharePoint .WebPartPages.W ebPartPage,Micr osoft.SharePoin t,Version=14.0. 0.0,Culture=neu tral,PublicKeyT oken=71e9bce111 e9429c"%>
MasterPageFile=
Inherits="Micro
If the page inherits publishing layouts page, the directive should be modified as shown below,
MOSS way of doing:
<%@ Page Language="C#" DynamicMasterPageFile="~ masterurl/default.master" Inherits="Microsoft. SharePoint.Publishing. Internal.CodeBehind. CategoriesPage"%>
SP 2010 way of doing:
Follow the below two steps to apply master page here. MasterPageFile tag is not supported directly.
1. <%@ Page Language="C#" Inherits="Microsoft. SharePoint.Publishing. PublishingLayoutPage, Microsoft.SharePoint,Version= 14.0.0.0,Culture=neutral, PublicKeyToken= 71e9bce111e9429c"%>
2. And, then under script tag, override "OnPreInit" method & assign master page there.
protected override void OnPreInit(EventArgs e){
base.OnPreInit(e);
this.MasterPageFile = "SomeOther.master";
}
