Interview Questions administrator

Best SharePoint administrator Interview Questions and Answers with topic wise:

Recycle Bin | MMS | ManagedVsCrawledProperties |

Thursday, February 16, 2012

How to deploy application pages using sandbox solution in SharePoint 2010

Before deploying the application pages using sandbox solution let me remind you all guys once again because in my interviews experience I have faced these 3 types of questions in most cases. What is mean by "application pages" and where are all the "application pages" have by default and difference between "site pages" and "application pages"?
Site pages are customized pages and are saved into the content database. so when you use the SharePoint designer to make custom changes it saves the changes in to the content database. if you want to make generic pages in a site collection which will be used by everyone, like "settings.aspx" page then you need to use application pages. In other words site pages are nothing but customized pages stored in the content, while application pages are generic pages which will be used by all the sites in a site collection.
All SharePoint built-in application pages are located under SharePoint hive templates/layouts folder. Whenever a web application is created a virtual directory called "_layouts" is created and it is mapped to the "layouts" folder in the corresponding IIS website. Using the most basic definition, a site page is customizable by an end user while an application page is not. That means that a user can pop open SharePoint Designer 2010 and make changes to a site page, but they cannot do this with an application page.

Hope all you guys understood what is mean by application pages and where are all the application pages have by default. Now, I will explain how to deploy application pages using sand box solution.
In SharePoint 2010 using sandbox solution you cannot deploy application pages to the SharePoint root on the server file system, typically within the _layouts virtual directory. In this we will be seeing how to manage the deployment of application pages using sandbox solution in SharePoint 2010. In sandbox solution the deployment must target the content database.

Steps Involved:
  • Open Visual Studio 2010 and Create a new Empty SharePoint Project (Name: DeployApplicationPagesInSandBox).    
  •   Enter the URL to the local site that you want to use for debugging. Note that Visual Studio 2010 does not support remote debugging. 
  • Right click on the project and add a new item.    
  • Select the "Module" template from the installed templates( Name: Admin)                  
  • Rename the "sample.txt" file to "SampleApplication.aspx" page. Here for the demo purpose i am adding the default.aspx page content. You can add as per your requirements in the "SampleApplication.aspx" page.
  • Once all the changes has done the solution looks like the following.
  • Now, open the "Element.xml" file and Replace the Elements.xml with the following( here i am deploying the "SampleApplicationPage" into the "Documents" document library.                 
  • Go to the SharePoint site => Documents => You could see the application page is deployed successfully using sandbox solution.
A quick reference on new features of application pages in SharePoint 2010 compared to SharePoint 2007?

The main drawback of application pages in SharePoint 2007, that they use a different master page than the rest of the pages in your site. As such, they don't follow your site branding.
SharePoint 2010 comes with new changes in application pages, which enables them to use the same master page that any other page in your site uses. Next, we'll see these changes in action so you know what changes you'll need to make in your SharePoint 2007 application pages when you decide to migrate them to SharePoint 2010 if you want your application pages use your site branding.

Thanks for Reading My Post.

No comments:

Post a Comment