In my previous post, I listed the sessions that I attended on SharePoint Saturday. Michael Lotter’s session was about building and deploying custom SharePoint Application Pages. Out-of-the-box pages suffice for more SharePoint users. But at some point, your customers or organization will want to add custom ASPX pages into SharePoint. This topic is relevant to teams wanting to create custom ASPX pages in SharePoint.
The basic ideas for building and deploying custom SharePoint Application Pages:
- Create a VS 2005 or VS 2008 solution
- Edit your ASPX pages, edit your code-behind
- Compile the solution—you should get the DLL files and the ASPX and/or ASCX files plus resource files such as images files (GIF, JPG, etc.)
- Create a new WSP Solution project in VS 2005 or VS 2008 using VSeWSS, Andrew Connell’s STSDEV, or Codeplex WSP Builder.
- In the WSP Solution, you put the ASPX and ASCX pages that you are trying to deploy.
- Also, the DLL that was compiled from Step 1 has to be included in the WSP Solution.
- Depending on which WSP tool you are using, the files location in the WSP solution might differ from one tool to another. But the key things you specify in the WSP Solution are the following: Manifest file and DDF file. If you have other things to add such as custom actions, you will also need to specify the Features file. The Manifest file specifies where the files in the WSP package will go.
- Compile the WSP solution.
- Run STSADM on the WSP file to deploy your custom files and pages.
Here’s a sample Manifest file:
<Solution SolutionId=”AAEC1250-5354-7839-F94F-50307E84AF1B” xmlns=”http://schemas.microsoft.com/sharepoint/”>
<TemplateFile Location=”Layouts\Zenpo\myZenpoBanner.JPG”/> </TemplateFiles >
<Assembly DeploymentTarget=”GlobalAssemblyCache” Location=”ZenpoSoftware.Sharepoint.myFeature.dll”/>
In the example manifest file above, my files went to the Layouts, Images, and ControlTemplates folder. Meanwhile, I specify that my custom assembly file should go to the GAC.
If you are creating custom pages or Web controls with no code-behind files (as-in it’s just all ASPX code or maybe a little bit of in-line server-side scripting), you can skip steps 1-3 and start at step 4 right away.
One thing worth nothing is if you’re going to deploy files to the 12-hive folder, it’s best that you create your own folder. In my example above, I specify in the manifest file that a “Zenpo” folder be created in the Layouts, ControlTemplates, and Images folder.
In the session, Michael Lotter deployed custom pages to the Layouts folder. He also had custom actions specified in the Elements.xml file that made the Site Actions menu include links to his custom pages.
It was a good session for those who have not yet done deployment of custom SharePoint pages in SharePoint. I will admit I was looking for something a bit more advanced but overall, the session was good since people who have never done this before can go back to their shop and should be able to build and deploy custom application pages.