You might be wondered what interesting requests you can get. One request i got was to create an application page which does not show the ribbon, the navigation, just nothing but an upload form for a SharePoint document library. The user should not see that he is uploading a file to a SharePoint library and that he is not working on SharePoint.
Sounds easy, but the important thing was to be able to use SharePoint Context and its features in Code. So today i show you how to create this application page which has nothing inside but the possibility to use all SharePoint features.
Step 1: Add an application page to your project into the layouts folder
I name it creazyPage.aspx.
Step 2: Customize the application page
There are some important to do’s:
At first go to your creazyPage.aspx and delete all Placeholders.
That means the following Placeholders: PageHead, Main, PageTitle, PageTitleInTitleArea.
Then delete the DynamicMasterPageFile in the <%@ Page Tag.
Then add the following line before the <%@ Page Tag:
< %@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=188.8.131.52, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
You are almost ready. If you deploy now your solution you should get a white page. So let’s proceed.
Now add your content. Start with
<head> <title>creazyPage</title> </head> <body> <form id="creazyPage" runat="server"> //[[ Here you can add your code like asp Controls or other Controls]] </form> </body>
Step 3: Deploy your solution
You solution should now look like this:
A cool trick:
Now if you add asp-Controls you see that you won’t get suggestions which controls are available. If you are smart, then you create your application page in the normal way till it is working as you want it to work . After that you just do the necessary changes described in step 2 and you’re done.
..:: I LIKE SHAREPOINT ::..The article or information provided here represents completely my own personal view & thought. It is recommended to test the content or scripts of the site in the lab, before making use in the production environment & use it completely at your own risk. The articles, scripts, suggestions or tricks published on the site are provided AS-IS with no warranties or guarantees and confers no rights.
He is Consultant for SharePoint Solutions for collaboration, communication and business processes. He provides his customers applications based on standard features as well as development or combining the power of several microsoft tools like Dynamics CRM. In his free time he tries to collect tipps and worthy experience in this blog.