Sunday, February 27, 2011

Creating and deploying Application page to your SharePoint application

What are application page?
Actually there are two types of page available in SharePoint.
1. Site Pages: Those pages which supports user customization by some designing tools e.g. SharePoint designer.
2.Application Pages: The pages which does not support user customization. You can find application pages in \Layout directory. You can create your own application page and you can deploy it to your sharepoint application.

Open visual studio and create a simple web application.

Paste the below code in your .aspx page.

<%@ Assembly Name="Microsoft.SharePoint, Version=12.0.0.0, 

Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>
<%@ Page Language="C#" MasterPageFile="~/_layouts/application.master"
Inherits="Microsoft.SharePoint.WebControls.LayoutsPageBase"%>

<%@ Import Namespace="Microsoft.SharePoint" %>



"Main" runat="server"
contentplaceholderid="PlaceHolderMain" >
Site Title: "lblSiteTitle" runat="server" />


Site ID: "lblSiteID" runat="server" />


"PageTitle" runat="server"
contentplaceholderid="PlaceHolderPageTitle" >
Hello World


"PageTitleInTitleArea" runat="server"
contentplaceholderid="PlaceHolderPageTitleInTitleArea" >
The Quintessential 'Hello World' of Application Page


Deployment

Note that although you can deploy your application pages directly inside the \LAYOUTS directory, doing so can create file name conflicts between your application pages and those application pages that are created by Microsoft and other companies. It is a best practice to deploy your application pages inside a company-specific or project-specific directory that is nested with the \LAYOUTS directory. For example, you can deploy application pages within a company-specific directory located at the path \LAYOUTS\your-project-folder-name

Now you can see your application page in your SharePoint application.

Lots more on Application page....coming soon......




No comments:

Post a Comment