Saturday, 7 October 2017

SharePoint Interview Questions and Answers

11. What is  Using Class in SharePoint ?

To dispose common SharePoint objects like SPWeb and SPSite. This is an important issue for production environments, since not correctly disposing objects will result in excessive memory and resource usage, while over-disposing can lead to error spamming in the SharePoint log files.

There’s a general rule: Dispose only and all objects that you created, but none that are passed to your method by another class or method.

By using statement when creating new instances of SPSite objects.

using (SPSite mySite = new SPSite("http://mysite.com"))

{

    SPWeb myWeb = mySite.RootWeb;

    ...

}

In above code the SPSite  object automatically destroy the object of RootWeb

using (SPSite mySite = new SPSite("http://mysite.com"))

{

    using (SPWeb myWeb = mySite.OpenWeb())

    {

        ...

    }

}

12. What is CAML queries ?

CAML - Collaborative Application Markup Language

 XML- Extensible Markup Language based query language

  Used to perform a query operation against SharePoint .

13. How to create SPSite object in Event Receivers ?

SPSite MysiteObj =propertises.Feature.Parent as SPSite

14. Type of Master Page ?

In SharePoint 2013 there are 2 default master pages, rather than only the 1 that was available in SharePoint 2010. The default master pages in SharePoint 2013 are named

oslo. master

seattle. master

 When we compare them visually, the only difference is that oslo doesn't have left side navigation

In general, seattle is designed for intranet team collaboration with more features such as  social, content\site navigation and management shortcuts.

While oslo master page is designed for published site which focus on page layout and content rendering.

The Oslo master page handles anonymous users differently as well. For instance, the top ribbon is completely removed for anonymous users, while Seattle keeps it.

The different types of master pages that are available in SharePoint 2010 are as follows:

v4.master - This is the default master page

default.master  - This is a master page that provides backward compatibility with MOSS 2007

minimal.master -

simple.master - This is used for the accessdenied, sign out, login, error pages etc.

Site Master Page

The site master page is used by all publishing pages, or pages that visitors to your website can see. It allows for the customization of publishing pages differently than system pages, and also allows for a different master page to be displayed to different devices using device channels. It is not used by any other page by default. Though it is possible to edit the master page using SharePoint Designer, it is not recommended unless absolutely necessary.

System Master Page

The system master page is used by SharePoint everywhere the site master page is not, including administrator pages, lists, and document library views. Be very careful customizing this page as it is used extensively throughout all SharePoint sites..

15.Site Provisioning / Feature stapling?

 A site provisioning provider is a piece of code that is run by a site definition when a new site is created. By default SharePoint performs the provisioning actions of a new site. These actions can include creation of lists, activation of features etc. and, most importantly, telling the site which site definition it should be based off. This is important because by declaring the site definition to base the site off you inevitably bind the site to that site definition.

Feature Stapling is a concept using which a specific feature will be stapled to site template.

Feature stapling is implemented through a Feature that is specifically designed to staple other Features to one or more site definitions. Feature stapling allows a Feature to be stapled to any new sites created from any site definition or from specific site definitions based on the template name identified in the appropriate WEBTEMP.xml file.

Feature Stapling has two features. A “Stapler” feature which staples another feature to the site definition and the “Staplee” feature which will be stapled. Let’s take an example to understand it.


Scenario: You want to have custom list added to all of the “Team site” site definitions. This can be solved by creating a feature which will add the Custom list to the site and it can be associated with the Team site’s site definition.


 

Thank you very much

          Fahadullah Karimi

         SharePoint Specialist


Previous SharePoint Interview Questions And AnswersNext SharePoint Interview Questions and Answers

No comments:

Post a Comment