Question

I have created a application page and I want it's design layout to look something like the standard Sharepoint pages like Add site column(fldNew.aspx) page. Could someone tell me how to accomplish this?

Was it helpful?

Solution

To mimic design of eq fldnew.aspx just go to \14\TEMPLATE\LAYOUTS on your SP server and find FldNew.aspx. Open it and copy page layout to your custom application page. But be careful not to break your custom application code inheritance!

After that you can play with design and add your own controls/code.

It is good practice to take a look at markup of some OOTB SP application pages when developing your custom ones. By doing so you will keep visual identity of SP intact.

OTHER TIPS

Your application page should be using a master page of the SharePoint site to accomplish this. Adding a code in your page OnPreInit might work -

protected override void OnPreInit(EventArgs e)
{
 base.OnPreInit(e);
 this.MasterPageFile =  SPContext.Current.Web.MasterUrl;
}

Check this blog post for similar ideas.

Application pages are now branded by default in SharePoint 2010.

The DynamicMasterPageFile attribute in SharePoint 2010 master pages allows application pages start using the site’s master page instead of the application master page. If you want backwards compatibility with SharePoint 2007, i.e. you want unbranded application pages, here is what you can do,

a) You can change the MasterPageReferenceEnabled property to false in your SPWebApplication object, or b) Go to central administration\application management\manage web application\select your web app … go to the ribbon, look for general settings\general settings, and detach application pages from the site’s master page.

If you would like to use default sharepoint master page you should use DynamicMasterPageFile in aspx file.

for example, you can find this directive in /_layouts/settings.aspx

<%@ Page Language="C#" DynamicMasterPageFile="~masterurl/default.master" Inherits="Microsoft.SharePoint.ApplicationPages.SettingsPage"   EnableViewState="false" EnableViewStateMac="false"    %>
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top