Pages

Sharepoint Interview Questions




62.Why would a developer use LINQ over CAML for data retrieval?
Unlike CAML, with LINQ to SharePoint provider, developers are working with strongly typed list item objects. For example, an item in the Announcements list is an object of type Announcement and an item on a Tasks list is an object of type Task. Developer can then enumerate the objects and get the properties for their use. In addition, developer can take benefit of LINQ syntax and the LINQ keywords built into C# and VB for LINQ queries.
63.What are the Disadvantages of Using LINQ in the Code?
LINQ translates the LINQ queries into Collaborative Application Markup Language (CAML) queries thus adding an extra step for retrieving the items.
64.What does AllowUnsafeUpdates do?
If developer is trying to modify Windows SharePoint Services data using code, developer may need to allow unsafe updates on the Web site, without requiring a security validation. For this, developer needs to set AllowUnsafeUpdates property to true.
65.What does RunWithElevatedPrivileges do? 
There are certain object models that call another model that require site-administration privileges. To bypass access-denied error, we use RunWithElevatedPrivileges property when a nonprivileged user initiates request. We can successfully make calls into the object model by calling the RunWithElevatedPrivileges method provided by the SPSecurity class.
66.How is a Content Type created?
We can create column and content types in three ways:
Using the SharePoint Foundation user interface.
Using the SharePoint Foundation object model.
Deploying a Feature that installs the content type based on an XML definition file.
67.How is a Content type deployed?
Content Type can be deployed and associated with list using feature. Inside the Feature, the feature.xml file contains references to all the element manifests within that Feature. Content type definitions are element manifests.
68.What is the scope of a content type?
A site content type becomes available to lists and document libraries within the site in which the content type is created and to the lists and document libraries in any child site.
69..What is an ancestral type and what does it have to do with content types?
An ancestral type is the base type that the content type is deriving from, such as Document (0x0101). The ancestral type will define the metadata fields that are included with the custom content type.
70.What is ghosted page and Un-ghosted page ? 
ghosted page: is a page in SharePoint website which is not stored in the database instead it reference to a file which exists in the server’s file system. These reference files are common for all the website/site collection within that SharePoint server, i.e., if user modify a reference file then that change will reflect in all the websites/site collections within that SharePoint server automatically.
Un-ghosted page: changes done in an un-ghosted page will not reflect in other websites within that SharePoint server.
71.Can web parts and web zones be added to an Application page? 
No, since Application pages does not support edit mode so web part zones and web parts cannot be added using SharePoint. However, static web parts can be added by editing then in Visual Studio, as web parts are nothing but controls with some extra functionality.
72.How to create a custom master page?
There are multiple ways to create custom master page files
  • By copying and editing existing master page.
  • By SharePoint Designer.
  • By editing minimal.master using editor.
73.How to apply a custom master page?
There are two ways to apply a custom master page
1. Custom Master Page can be deployed using SharePoint Feature by which master page gets uploaded to the master page gallery.
2. Custom master page can be uploaded directly in master page gallery library and apply the same master page using site and system master page option in Site Settings page by selecting Master Page option.
74.Can developer use the custom master page with the application pages in SharePoint 2010? 
With 2010, developer can now set whether the pages under _Layouts use the same Master Page as the rest of the site. Developer can enable or disable this functionality through the web application settings in Central Administration. This however, is not applicable to the custom application pages. If developer wants the custom application page to inherit the site master page, he must derive it from Microsoft. SharePoint. Web Controls. Layouts Page Base class.
75.How to link the custom CSS file in the master page?
Custom CSS files can be linked to the master pages with the help of a class called Sharepoint:CssRegistration.

No comments:

Post a Comment