Microsoft TS: Office SharePoint Server, Application Development (available in 2010) Sample Questions:
1. You have a helper method named CreateSiteColumn that contains the following code segment.
private static void CreateSiteColumn(SPWeb web, string columnName) { }
You need to add a new site column of type Choice to a SharePoint site by using the helper method.
Which code segment should you include in the helper method?
A) web.Fields.Add(columnName, SPFieldType.Choice, true);
B) web.Lists[0].Fields.Add(columnName, SPFieldType.Choice, True);
C) web.Lists[0].Views[0].ViewFields.Add(columnName);
D) SPField field = new SPFieldChoice(System.web.Lists[0].Fields, columnName);
2. You create a SharePoint site by using the Document Center site template.
You need to ensure that all documents added to the site have a document ID. The document ID must
include the date that the document was added to the site.
What should you do?
A) Modify the DocIdRedir.aspx page.
B) Register a class that derives from DocumentIdProvider.
C) Modify the Onet.xml file of the site.
D) Register a class that derives from DocumentId.
3. You have a SharePoint site that has the URL http://contoso.com/hr.
You are creating a new Web Part.
You need to create a reference to the current subsite without having to dispose of any returned objects.
Which code segment should you use?
A) SPSite siteCollection = new SPSite("http://www.contoso.com");SPWeb site = siteCollection.RootWeb;
B) SPWeb site = SPContext.Current.Web;
C) SPSite siteCollection = new SPSite("http://www.contoso.com");SPWebCollection site = siteCollection.AllWebs;
D) SPSite site = SPContext.Current.Site;
4. You develop a custom master page.
You need to ensure that all pages that use the master page contain a specific image.
Page developers must be able to change the image on individual pages. The master page must be
compatible with the default content page.
What should you add to the master page?
A) a ContentPlaceHolder control
B) an HTML Div element
C) a PlaceHolder control
D) a Delegate control
5. You create a Web Part that programmatically updates the description of the current SharePoint site.
The Web Part contains the following code segment. (Line numbers are included for reference only.)
01 SPSecurity.RunWithElevatedPrivileges(delegate()
02 {
03 SPSite currSite = SPContext.Current.Site;
04 SPWeb currWeb = SPContext.Current.Web;
05 using (SPSite eSite = new SPSite(currSite.ID))
06 {
07 using (SPWeb eWeb = eSite.OpenWeb(currWeb.ID))
08 {
09 eWeb.AllowUnsafeUpdates = true;
10 currWeb.Description = "Test";
11 currWeb.Update();
12 eWeb.AllowUnsafeUpdates = false;
13 }
14 }
15 });
Users report that they receive an Access Denied error message when they use the Web Part. You need to ensure that all users can use the Web Part to update the description of the current site.
What should you do?
A) Change lines 09 and 12 to use the currWeb variable.
B) Remove lines 10 and 11.
C) Change lines 10 and 11 to use the eWeb variable.
D) Remove lines 09 and 12.
Solutions:
| Question # 1 Answer: A | Question # 2 Answer: B | Question # 3 Answer: B | Question # 4 Answer: A | Question # 5 Answer: C |
We're so confident of our products that we provide no hassle product exchange.


By Christ

