SP2010 Qs

Download as pdf or txt
Download as pdf or txt
You are on page 1of 47

Page 1 of 47

Question No: 1 You create a Web Part that contains the following code segment. (Line numbers are included for reference only.) 01public?class?WebPart1?:?WebPart 02 { 03 public?WebPart1(){} 04? 05 protected?override?void?CreateChildControls() 06 { 07 Button?clickButton?=?new?Button(); 08? 09 base.CreateChildControls(); 10 } 11? 12 protected?override?void?RenderContents(HtmlTextWriter?writer) 13 { 14? 15 base.RenderContents(writer); 16 } 17 } You discover that the clickButton button does not appear. You need to ensure that clickButton appears. What should you do? Category: A. Delete line 09. B. Move line 07 to line 14. C. Add the following line of code at line 08.Controls.Add(clickButton); D. Add the following line of code at line 08.clickButton.Page?=?this.Page; Answer: C Question No: 2 You have a SharePoint list named Assets that contains 1,000,000 items. The list contains a column named Urgent. Approximately 100 items have a value of True in their Urgent column. You use the following line of code to retrieve the Assets list. SPList?assetsList?=?currentWeb.Lists["assets"]; You need to retrieve all of the items in the list that have a value of True in their Urgent column. You must retrieve the items in the minimum amount of time. What should you do? Category: A. Iterate through the assetsList.Items collection. B. Iterate through the assetsList.Fields collection. C. Call assetsLists.GetItems and specify the SPQuery parameter. D. Call assetsList.Items.GetDataTable() and retrieve DataRowCollection. Answer: C

Copyrights 2007 Selftest Engine, all rights Reserved.

Page 2 of 47 Question No: 3 You need to create a Web Part that displays all of the content created by a specific user. You write the following code segment. (Line numbers are included for reference only.) 01private?void?FullTextQueryExecute(string?searchAuthor) 02{ 03FullTextSqlQuery?qry?=?new?FullTextSqlQuery (ServerContext.GetContext(SPContext.Current.Site)); 04qry.ResultTypes?=?ResultType.RelevantResults; 05? 06qry.QueryText?=?strQuery; 07ResultTableCollection?results?=?qry.Execute(); 08} Which code segment should you add at line 05? Category: A. string?strQuery?=?"author:"?+?searchAuthor; B. string?strQuery?=?"docID:"?+?searchAuthor; C. string?strQuery?="SELECT?Title,Author,Path?FROM?SCOPE()?WHERE?author?=?'"?+?searchAuthor?+"'"; D. string?strQuery?=?"SELECT?Title,Creator,Path?FROM?SCOPE()?WHERE?docID?=?'"?+?searchAuthor?+"'"; Answer: C Question No: 4 You create a Web Part. You need to display the number of visits to a SharePoint site collection in a label named LblVisits. You write the following code segment. (Line numbers are included for reference only.) 01SPSecurity.RunWithElevatedPrivileges(delegate() 02?{ 03 try 04 { 05 06 LblVisits.Text?=?site.Usage.Visits.ToString(); 07 } 08 finally 09 { 10 ... 11 } 12?} 13); Which code segment should you add at line 05? Category: A. SPSite?site?=?new?SPSite(SPContext.Current.Site.ID); B. SPSite?site?=?SPContext.Current.Site; C. SPSite?site?=?SPContext.GetContext(HttpContext.Current).Site; D. SPSite?site?=?SPControl.GetContextSite(HttpContext.Current); Answer: A Question No: 5 You are developing an application page. You need to create a pop-up window that uses the ECMAScript object model. Which namespace should you use? Category: A. SP.UI.Menu B. SP.UI.ModalDialog Copyrights 2007 Selftest Engine, all rights Reserved.

Page 3 of 47 C. SP.UI.Notify D. SP.UI.PopoutMenu Answer: B Question No: 6 You have a SharePoint site that contains 10 lists. You need to prevent a list named List1 from appearing on the Quick Launch navigation bar. What should you configure? Category: A. the Hidden property of List1 B. the Navigation.QuickLaunch.Parent.IsVisible property of the site C. the OnQuickLaunch property of List1 D. the QuickLaunchEnabled property of the site Answer: C Question No: 7 You create a Feature. You need remove the link to the Site Content Type page from the Site Settings page by using the Feature. Which element should you use in the Feature? Category: A. ContentType B. ContentTypeBinding C. HideCustomAction D. Module Answer: C Question No: 8 You need to create a Web control that displays HTML content during the last stage of the page processing lifecycle. Which method should you override in the Web control? Category: A. LoadControlState B. Render C. SaveViewState D. SetDesignModeState Answer: B Question No: 9 You have a custom Web Part that is deployed as a sandboxed solution. You need to ensure that the Web Part can access the local file system on a SharePoint server. You must minimize the amount of privileges assigned to the Web Part. What should you do? Category: A. Elevate the trust level to Full. B. Elevate the trust level to WSS_Medium. C. Redeploy the Web Part as a farm solution.

Copyrights 2007 Selftest Engine, all rights Reserved.

Page 4 of 47 D. Deploy the Web Part to the Global Assembly Cache (GAC). Answer: C Question No: 10 You create a SharePoint farm solution that contains a Web Part. You need to debug the Web Part by using Microsoft Visual Studio 2010. To which process should you attach the debugger? Category: A. owstimer.exe B. spucworkerprocess.exe C. spucworkerprocessproxy.exe D. w3wp.exe Answer: D Question No: 11 You have a SharePoint site that uses a master page named Master1.master. You create a custom user control named MySearch.ascx. You need to change the default search box to MySearch.ascx. What should you do? Category: A. Modify the SmallSearchInputBox control tag in the master page, and then configure the ControlId property. B. Modify the SmallSearchInputBox control tag in the master page, and then configure the ControlSrc property. C. Create a Web Part that uses MySearch.ascx. In the master page, add a control tag that references the .webpart file. D. Create a Visual Web Part that uses MySearch.ascx. In the master page, add a control tag that references the .webpart file. Answer: B Question No: 12 You create a custom page layout that contains the following code segment. (Line numbers are included for reference only.) 01Please?enter?a?number: 02<SharePointWebControls:InputFormTextBox ID="NumberTextBox"?runat="server"/> 03? You need to prevent the page from being saved if NumberTextBox is empty. Which code segment should you add at line 03? Category: A. <script?type="javascript">if(document.getElementById('NumberTextBox').value?=?'')?return?false;</script> B. <script?type="javascript">if(document.getElementById('NumberTextBox').value?=?'')?return?true;</script> C. <SharePointWebControls:InputFormCompareValidator?ID="NumberValidator" runat="server"? ControlToValidate="NumberTextBox"/> D. <SharePointWebControls:InputFormRequiredFieldValidator?ID="NumberValidator" runat="server"? ControlToValidate="NumberTextBox"/> Answer: D Question No: 13 You create a custom page layout that contains code-behind. You need to identify whether the page is in Edit mode or in Display mode. What should you use? Category: A. SPContext.Current.FormContext Copyrights 2007 Selftest Engine, all rights Reserved.

Page 5 of 47 B. SPContext.Current.ListItem.Properties C. this.Form D. this.Web.ASPXPageIndexMode Answer: A Question No: 14 You create a Business Connectivity Services (BCS) object model in Microsoft Visual Studio 2010. The model connects to an XML file. You create an external list that displays the BCS entity. You need to ensure that users can delete items from the external list. What should you do? Category: A. Call the SPList.Delete() method. B. Call the SPListItem.Delete() method. C. Create a custom method and specify the method as a Deleter method instance. D. Create a custom method and specify the method as a Disassociator method instance. Answer: C Question No: 15 You are creating an application for SharePoint Server 2010. The application will run on a remote computer. You need to identify a data access method to query lists in the application. Strongly-typed access to columns must be provided from within Microsoft Visual Studio 2010. Which method should you use? Category: A. client object model B. LINQ to SharePoint C. Representational State Transfer (REST) D. server object model Answer: C Question No: 16 You create a custom list named Products. You need to perform a Representational State Transfer (REST) query that returns products 30 to 39. Which URL should you use? Category: A. /ListData.svc/Products(30)?$skip=10 B. /ListData.svc/Products(39)?$skip=30 C. /ListData.svc/Products?$skip=10&$top=30 D. /ListData.svc/Products?$skip=30&$top=10 Answer: D Question No: 17 You need to create a Microsoft .NET Framework console application that queries a list by using the SharePoint client object model. Which two assemblies should you reference? (Each correct answer presents part of the solution. Choose two.) Category: A. Microsoft.Office.Sharepoint.ClientExtensions.dll B. Microsoft.SharePoint.Client.dll Copyrights 2007 Selftest Engine, all rights Reserved.

Page 6 of 47 C. Microsoft.SharePoint.Client.Runtime.dll D. Microsoft.SharePoint.Client.Silverlight.Runtime.dll Answer: B, C Question No: 18 You have a Web application named WebApp1. You have a Feature receiver named FeatureReceiver1. FeatureReceiver1 stores a connection string in the web.config file of WebApp1. You need to ensure that when FeatureReceiver1 makes configuration changes to web.config, the changes are automatically replicated to all Web servers in the farm. Which class should you use in FeatureReceiver1? Category: A. SPDiagnosticsService B. SPPersistedObject C. SPWebConfigModification D. WebConfigurationManager Answer: C Question No: 19 You need to create a Web Part that will store and retrieve information for the current subsite. Which object should you use? Category: A. SPContext.Current.Site.RootWeb.AllProperties B. SPContext.Current.Site.RootWeb.Configuration C. SPContext.Current.Web.Configuration D. SPContext.Current.Web.Properties Answer: D Question No: 20 You use a third-party site definition to create SharePoint sites. You need to add a Web Part to the home page of the site definition. Which file should you modify? Category: A. default.master B. Onet.xml C. Sp.xml D. web.config Answer: B Question No: 21 You create an entity named Customer in a Business Connectivity Services (BCS) object model. You need to ensure that Customer data can be displayed in a Business Data List Web Part. Which method type should you use? Category: A. Finder B. Genericlnvoker C. IDEnumerator Copyrights 2007 Selftest Engine, all rights Reserved.

Page 7 of 47 D. SpecificFinder Answer: A Question No: 22 You need to delete the previous versions of all documents in a document library. The deleted versions of the documents must be retained in the SharePoint Recycle Bin. What should you do? Category: A. For the document library, call the Recycle method. B. For the document library, call the Delete method. C. For each document, call the DeleteAll method of the Versions property. D. For each document, call the RecycleAll method of the Versions property. Answer: D Question No: 23 You are creating an application. You develop a custom control that renders a contextual tab. The control contains the following code segment. (Line numbers are included for reference only.) 01protected?override?void?OnPreRender(EventArgs?e) 02 { 03 SPRibbon?curRibbon?=?SPRibbon.GetCurrent(this.Page); 04 05 curRibbon.MakeContextualGroupInitiallyVisible ("SP.Ribbon.ContextualGroup",?string.Empty); 06 base.OnPreRender(e); 07 }You need to ensure that when the custom control is rendered, the custom contextual tab appears in the Ribbon. Which code segment should you add at line 04? Category: A. curRibbon.Enabled?=?true; B. curRibbon.MakeRTEContextualTabsAvailable("SP.Ribbon.ContextualTab"); C. curRibbon.MakeTabAvailable("SP.Ribbon.ContextualTab"); D. curRibbon.Visible?=?true; Answer: C Question No: 24 You create custom code to import content to SharePoint sites. You create a custom site definition by using Microsoft Visual Studio 2010. You need to ensure that when a new site that uses the site definition is created, the custom code executes after the site is created. Which class should you add to the project? Category: A. SPChangeFile B. SPItemEventReceiver C. SPWebEventReceiver D. SPWebProvisioningProvider Answer: D

Copyrights 2007 Selftest Engine, all rights Reserved.

Page 8 of 47 Question No: 25 You need to create a custom Web Part that meets the following requirements: Includes all of the functionalities of the Search Results Web Part .Includes additional filters based on the current user department What should you do? Category: A. Create a Web Part that inherits the CoreResultsWebPart class. B. Create a Web Part that inherits the SearchResultsBaseDatasource class. C. Modify the SearchDisco.aspx page and modify the descriptor file for the Search Summary Web Part. D. Modify the SearchDisco.aspx page and modify the descriptor file for the Search Core Results Web Part. Answer: A Question No: 26 You are creating an event receiver. The event receiver will have a field named Title and a field named Priority. You write the following code segment for the event receiver. (Line numbers are included for reference only.) 01public?override?void?ItemUpdating(SPItemEventProperties?prop) 02{ 03 base.ItemUpdating(prop); 04? 05? 06} You need to ensure that when the Title field is changed to include the word IMPORTANT, the Priority field is set to URGENT. Which code segments should you add at lines 04 and 05? Category: A. 04if(prop.AfterProperties["vti_title"].ToString().Contains("IMPORTANT"))05prop.AfterProperties["Priority"]? =?"URGENT"; B. 04if(prop.AfterProperties["vti_title"].ToString().Contains("IMPORTANT"))05prop.ListItem["Priority"]? =?"URGENT"; C. 04if(prop.BeforeProperties["vti_title"].ToString().Contains("IMPORTANT"))05prop.AfterProperties["Priority"]? =?"URGENT"; D. 04if(prop.ListItem["Title"].ToString().Contains("IMPORTANT"))05prop.AfterProperties["Priority"]?=?"URGENT"; Answer: A Question No: 27 You have a Web application that contains the following code segment. void?CreatingSPSite() { SPSite?siteCollection?=?null; try { siteCollection?=?new?SPSite("http://contoso.com"); } finally { } } You need to prevent the code segment from causing a memory leak. Which line of code should you add to the code segment? Category: A. if?(siteCollection?!=?null) siteCollection.Close(); B. if?(siteCollection?!=?null) siteCollection.Dispose(); C. siteCollection?=?null; Copyrights 2007 Selftest Engine, all rights Reserved.

Page 9 of 47 D. siteCollection.WriteLocked?=?false; Answer: B Question No: 28 You need to schedule a timer job to run every two hours. Which schedule should you use? Category: A. SPDailySchedule B. SPHourlySchedule C. SPMinuteSchedule D. SPOneTimeSchedule Answer: C Question No: 29 You plan to create a custom Web Part that displays items from a custom SharePoint list named Project. You need to ensure that you can access the list by using strongly-typed objects in Microsoft Visual Studio 2010. What should you do first? Category: A. Run spmetal.exe. B. Run ecmangen.exe. C. Edit the web.config file. D. Edit the Manifest.xml file. Answer: A Question No: 30 You need to connect two Web Parts by using the IWebPartRow interface. Which method should you use? Category: A. DataItem B. GetFieldValue C. GetRowData D. GetTableData Answer: C Question No: 31 You are creating two Web Parts named WPMaster and WPDetails. You need to ensure that when an item is selected from WPMaster, the details of the item are displayed in WPDetails. What should you implement in WPMaster? Category: A. ICellProvider B. IListProvider C. IWebPartRow D. IWebPartTable Answer: C

Copyrights 2007 Selftest Engine, all rights Reserved.

Page 10 of 47 Question No: 32 You need to create a Web Part that hides the out-of-the-box Ribbon on the current page. Which code segment should you include in the Web Part? Category: A. SPRibbon.GetCurrent(this.Page).CommandUIVisible?=?false; B. SPRibbon.GetCurrent(this.Page).Dispose(); C. this.Page.FindControl("SPRibbon").Dispose(); D. this.Page.FindControl("SPRibbon").Visible?=?false; Answer: A Question No: 33 You have a document library named MyDocs. MyDocs has a column named Column1. Column1 is a required column. You discover that many documents are checked out because users fail to enter a value for Column1. You need to create a Web Part to delete the documents. Which code segment should you include in the Web Part? Category: A. foreach?(SPCheckedOutFile?file?in?((SPDocumentLibrary) SPContext.Current.Web.Lists ["MyDocs"]).CheckedOutFiles) file.Delete(); B. foreach?(SPCheckedOutFile?file?in?((SPDocumentLibrary) SPContext.Current.Web.Lists ["MyDocs"]).CheckedOutFiles) file.TakeOverCheckOut(); C. foreach?(SPItem?file?in?SPContext.Current.Web.Lists["MyDocs"].Items){ if?(file["CheckOutStatus"]? ==?"CheckOut") file.Delete();} D. foreach?(SPListItem?file?in?((SPDocumentLibrary)SPContext.Current.Web.Lists["MyDocs"]).Items){ if?(file ["CheckOutStatus"]?==?"CheckOut") file.Delete();} Answer: A Question No: 34 You create a custom site definition named DCS. You create a site provision handler for DCS. DCS contains a file named DCSTemplate.xsd that stores configuration data. You need to read the content of DCSTemplate.xsd in the site provision handler. Which property should you use? Category: A. SPSite.GetCustomWebTemplates(1033)["DCS"].ProvisionClass B. SPWebApplication.DataRetrievalProvider C. SPWebProvisioningProperties.Data D. SPWebProvisioningProperties.Web.DataRetrievalServicesSettings Answer: C Question No: 35 You are creating a custom content type named CT1. You need to use a Feature to add an existing site column named SiteCol1 to CT1. Which code segment should you include in the Feature? Category: A. <Field?ID="SiteCol1"/> B. <Field?ID="{XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX}"?Name="SiteCol1"/> C. <FieldRef?ID="SiteCol1"?Name="{XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX}"/> D. <FieldRef?ID="{XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX}"?Name="SiteCol1"/> Answer: D Copyrights 2007 Selftest Engine, all rights Reserved.

Page 11 of 47 Question No: 36 You plan to create a workflow that has the following three activities: CreateTask .OnTaskChanged .CompleteTask You need to ensure that each time the workflow starts, the three activities are linked to a single task. What should you do? Category: A. Configure all activities to use the same TaskId. B. Configure all activities to use the same correlation token. C. Create an SPItemEventReceiver event receiver for the SharePoint Tasks list. D. Create an SPWorkflowEventReceiver event receiver for the SharePoint Tasks list. Answer: B Question No: 37 You deploy a custom Web Part named WebPart1 to a SharePoint site. WebPart1 contains the following code segment. (Line numbers are included for reference only.) 01protected?void?Page_Load(object?sender,?EventArgs?e) 02{ 03 SPSite?site?=?null; 04 try 05 { 06 site?=?new?SPSite("http://www.contoso.com/default.aspx"); 07 SPWeb?web?=?site.OpenWeb(); 08? 09 ... 10 } 11 catch 12 { 13 14 } 15 finally 16 { 17 18 } 19} After you deploy WebPart1, users report that the pages on the site load slowly. You retract WebPart1 from the site. Users report that the pages on the site load without delay. You need to modify the code in WebPart1 to prevent the pages from loading slowly. What should you do? Category: A. Add the following line of code at line 08.site.ReadOnly?=?true; B. Add the following line of code at line 13.site.Dispose(); C. Add the following line of code at line 17.site.Dispose(); D. Add the following line of code at line 17.site.ReadOnly?=?true; Answer: C

Copyrights 2007 Selftest Engine, all rights Reserved.

Page 12 of 47 Question No: 38 You need to create a Web Part that displays all social tags entered by users. Which code segment should you use? Category: A. TaxonomySession?session?=?new?TaxonomySession(SPContext.Current.Site);TermSet?socialTags?=? session.DefaultKeywordsTermStore.SystemGroup.TermSets["Keywords"]; B. TaxonomySession?session?=?new?TaxonomySession(SPContext.Current.Site);TermSet?socialTags?=? session.DefaultKeywordsTermStore.SystemGroup.TermSets["Tags"]; C. TermSet?socialTags?=?(TermSet)?SPContext.Current.Site.WebApplication.Properties["Tags"]; D. TermSet?socialTags?=?(TermSet)?SPContext.Current.Web.AllProperties["Keywords"]; Answer: A Question No: 39 You are creating a Business Connectivity Services (BCS) entity. You need to ensure that all data returned by the entity is available in search results. Which type of method instance should you implement? Category: A. Finder and GenericInvoker B. Finder and IDEnumerator C. SpecificFinder and GenericInvoker D. SpecificFinder and IDEnumerator Answer: D Question No: 40 You create a Web Part that updates a list. You need to ensure that users can use the Web Part to update the list, regardless of the users' permissions to the list. What should you use in the Web Part? Category: A. the SPSecurity.AuthenticationMode property B. the SPSecurity.CatchAccessDeniedException property C. the SPSecurity.RunWithElevatedPrivileges method D. the SPSecurity.SetApplicationCredentialKey method Answer: C Question No: 41 You are developing a Feature that will be used in multiple languages. You need to ensure that users view the Feature's title and description in the display language of their choice. What should you create? Category: A. a Feature event receiver B. a site definition C. multiple Elements.xml files D. multiple Resource (.resx) files Answer: D

Copyrights 2007 Selftest Engine, all rights Reserved.

Page 13 of 47 Question No: 42 You have the following event receiver. (Line numbers are included for reference only.) 01public?override?void?FieldDeleting (SPListEventProperties?properties) 02 { 03 base.FieldDeleting(properties); 04? 05 if?(properties.FieldName?==?"Status") 06 { 07? 08? 09 } 10 } You need to cancel the operation and redirect the user to a custom error page if the name of the deleted field is Status. Which code segments should you add at lines 07 and 08? Category: A. 07properties.ErrorMessage?=?"<Redirect?URL?=?'/_layouts/customErrorPage.aspx' />";08properties.Cancel? =?true; B. 07properties.RedirectUrl?=?"/_layouts/customErrorPage.aspx";08properties.Cancel?=?true; C. 07properties.Status?=?SPEventReceiverStatus.CancelWithRedirectUrl;08properties.ErrorMessage? =?"<Redirect?URL?=?'/_layouts/customErrorPage.aspx' />"; D. 07properties.Status?=?SPEventReceiverStatus.CancelWithRedirectUrl;08properties.RedirectUrl? =?"/_layouts/customErrorPage.aspx"; Answer: D Question No: 43 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? Category: A. a ContentPlaceHolder control B. a Delegate control C. a PlaceHolder control D. an HTML Div element Answer: A Question No: 44 You create a custom site definition. You need to modify the contents of the Quick Launch are a. Which file should you modify? Category: A. Onet.xml B. Schema.xml C. VWStyles.xml D. WebTemp.xml Answer: A

Copyrights 2007 Selftest Engine, all rights Reserved.

Page 14 of 47 Question No: 45 You need to create a custom application that provides users with the ability to create a managed property. The managed property name must be specified in the args[1] parameter. You write the following code segment for the application. (Line numbers are included for reference only.) 01SPSite?currentSite?=?new?SPSite("http://intranet"); 02SearchContext?context?=?SearchContext.GetContext(currentSite); 03Schema?schema?=?new?Schema(context); Which code segment should you add to the application? Category: A. context.SearchApplication.CrawlStores.Create(args[1]); B. ManagedPropertyCollection?properties?=?schema.AllManagedProperties;ManagedProperty?newMng?=? properties.Create(args[1],?ManagedDataType.Text); C. ManagedPropertyCollection?properties?=?schema.AllManagedProperties;ManagedProperty?newMng?=? properties.CreateCrawlMonProperty();newMng.Name?=?args[1]; D. schema.AllCategories.Create(args[1],?Guid.NewGuid()); Answer: B Question No: 46 You have a Web Part named WebPart1. WebPart1 runs on a Microsoft Office SharePoint Server 2007 server. You need to ensure that WebPart1 can run as a sandboxed solution in SharePoint Server 2010. What should you do? Category: A. Create a new Web Part by using the code from WebPart1. B. Create a new Visual Web Part by using the code from WebPart1. C. Create an ASCX file for WebPart1, and then copy the file to the ISAPI folder. D. Create an ASCX file for WebPart1, and then copy the file to the CONTROLSTEMPLATES folder. Answer: A Question No: 47 You create a class that inherits the SPPersistedObject class. The class has a field named Field1. You need to ensure that Field1 can be serialized and stored in the SharePoint configuration database. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two) Category: A. Add the default empty constructor. B. Mark Field1 with the [Persisted] attribute. C. Mark Field1 with the [Serializable] attribute. D. Set the value of the SPWeb.AllowUnsafeUpdate property. Answer: A, B Question No: 48 You create and deploy a custom Web Part. You add the Web Part to a page and receive a run-time error. You need to display the detailed information of the error on the page. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.) Category: A. In the web.config file, set CallStack="True". B. In the web.config file, set customErrors="RemoteOnly". C. In the registry, set the EnableDebug value to 1.

Copyrights 2007 Selftest Engine, all rights Reserved.

Page 15 of 47 D. In the registry, set the DisableLoopbackCheck value to 1. Answer: A, B Question No: 49 You have a SharePoint site collection that has the URL http://contoso/sites/finance. You are creating a Microsoft .NET Framework console application that will use the SharePoint client object model to create a site in the site collection. The application contains the following code segment. (Line numbers are included for reference only.) 01ClientContext?cCtx?=?new?ClientContext("http://contoso/sites/finance"); 02Web?root?=?cCtx.Site.RootWeb; 03cCtx.Load(root); 04WebCreationInformation?webInfo?=?new?WebCreationInformation(); 05webInfo.Title?=?"site1"; 06webInfo.Url?=?"site1"; 07webInfo.WebTemplate?=?"MPS#2"; 08root.Webs.Add(webInfo); 09? 10cCtx.Dispose(); You need to ensure that the application creates the site. Which code segment should you add at line 09? Category: A. cCtx.ExecuteQuery(); B. cCtx.Site.RootWeb.Update(); C. root.Context.Dispose(); D. root.Update(); Answer: A Question No: 50 You create two custom lists named Offices and Rooms. Rooms has the following columns: Title .Capacity .Equipment Offices has the following columns: Title .Rooms (a lookup to the Title column in the Rooms list) .Rooms:Capacity .Rooms:Equipment You need to perform a Representational State Transfer (REST) query that returns a list of all the offices that have rooms with a capacity of 10. The query results must include the room titles and the equipment in each room. Which URL should you choose? Category: A. /_vti_bin/ListData.svc/Offices?$expand=Rooms&$filter=Rooms/Capacity eq 10 B. /_vti_bin/ListData.svc/Offices?&$filter=Rooms/Capacity eq 10 C. /_vti_bin/ListData.svc/Rooms?$expand=Offices&$filter=Rooms/Capacity eq 10 D. /_vti_bin/ListData.svc/Rooms?&$filter=Offices/Capacity eq 10 Answer: A

Copyrights 2007 Selftest Engine, all rights Reserved.

Page 16 of 47 Question No: 51 You have a custom site definition. You create a custom site Feature. You need to ensure that the Feature is activated for all new sites that are created by using the custom site definition. What should you do? Category: A. Modify the Onet.xml file. B. Modify the web.config file. C. Add a Feature receiver to the custom site Feature. D. Add a Feature dependency to the custom site Feature. Answer: A Question No: 52 You plan to add a custom tab to the Ribbon in a SharePoint Web application. You create a custom Feature that contains an Elements.xml file. You need to ensure that the custom tab only appears in the document libraries of the Web application. Which code segment should you add to the CustomAction node of the Elements.xml file? Category: A. Location="DocumentLibrary" B. RegistrationId="101" C. RegistrationType="List" D. ShowInLists="false" Answer: B Question No: 53 You create a Web Part by using Microsoft Visual Studio 2010. You need to execute SPDisposeCheck.exe before the Web Part is deployed. What should you do? Category: A. Configure a pre-deployment command line. B. Configure SPDisposeCheck.exe as an external tool. C. Change the configuration from Active (Debug) to Release. D. Change the active deployment configuration to No Activation. Answer: A Question No: 54 You have a custom theme named MyTheme. The theme is defined in a file named MyTheme.thmx. You have a console application that contains the following code segment. (Line numbers are included for reference only.) 01using?(SPSite?site?=?new?SPSite("http://intranet")) 02{ 03 SPWeb?web?=?site.OpenWeb(); 04 ... 05} You need to programmatically apply the theme to a SharePoint site. Which code segment should you add to the console application? Category: A. ThmxTheme.SetThemeUrlForWeb(web, "/_catalogs/theme/MyTheme.thmx", false); Copyrights 2007 Selftest Engine, all rights Reserved.

Page 17 of 47 B. web.AlternateCssUrl?=?"/_themes/MyTheme"; C. web.ApplyWebTemplate("MyTheme.thmx"); D. web.ThemedCssFolderUrl?=?"/_themes/MyTheme"; Answer: A Question No: 55 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.) 01SPSecurity.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} 16); 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? Category: A. Remove lines 09 and 12. B. Remove lines 10 and 11. C. Change lines 10 and 11 to use the eWeb variable. D. Change lines 09 and 12 to use the currWeb variable. Answer: C Question No: 56 You are creating a Web Part. The Web Part will be used in a SharePoint subsite that has the URL http://www.contoso.com/hr. You need to ensure that the Web Part activates a Feature in the subsite without causing a memory leak. Which code segment should you use? Category: A. SPFeatureCollection?featuresCollect?=?SPContext.Current.SiteFeatures;featureCollect.Add(new?Guid ("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"),?true); B. SPFeatureCollection?featuresCollect?=?SPContext.Current.WebFeatures;featureCollect.Add(new?Guid ("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"),?true); C. SPSite?web?=?new?SPSite("http://www.contoso.com/hr");SPFeatureCollection?featureCollect?=? web.Features;featureCollect.Add(new?Guid("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"),?true); D. SPWeb?web?=?new?SPSite("http://www.contoso.com/hr").OpenWeb();SPFeatureCollection?featureCollect? =?web.Features;featureCollect.Add(new?Guid("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"),?true); Answer: B

Copyrights 2007 Selftest Engine, all rights Reserved.

Page 18 of 47 Question No: 57 You plan to create a Web Part for a SharePoint site. You need to ensure that the Web Part can send data to other Web Parts in the site. What should you do? Category: A. Implement the IAlertNotifyHandler interface. B. Implement the IAlertUpdateHandler interface. C. Create a custom interface that uses the WebBrowsable and the WebPartStorage attributes. D. Create a custom interface that uses the ConnectionProvider and ConnectionConsumer attributes. Answer: D Question No: 58 You create an event receiver. The ItemAdded method for the event receiver contains the following code segment. (Line numbers are included for reference only.) 01SPWeb recWeb = properties.Web; 02using (SPSite siteCollection = new SPSite("http://site1/hr")) 03 { 04 using (SPWeb web = siteCollection.OpenWeb()) 05 { 06 PublishingWeb oWeb = PublishingWeb.GetPublishingWeb(web); 07 PublishingWebCollection pubWebs = oWeb.GetPublishingWebs(); 08 foreach (PublishingWeb iWeb in pubWebs) 09 { 10 try 11 { 12 SPFile page = web.GetFile("/Pages/default.aspx"); 13 SPLimitedWebPartManager wpManager = page.GetLimitedWebPartManager(PersonalizationScope.Shared); 14 } 15 finally { 16 if (iWeb != null) iWeb.Close(); 17 } 18 } 19 } You need to prevent the event receiver from causing memory leaks. Which object should you dispose of? Category: A. oWeb at line 6 B. recWeb at line 1 C. wpManager at line 13 D. wpManager.Web at line 13 Answer: D Question No: 59 You have a SharePoint list named Projects and a site column named PrivateColumn. You need to prevent users from adding PrivateColumn to the Projects list. Users must be able to add any other site column to the Projects list. What should you do? Category: A. Create an event receiver that inherits SPListEventReceiver and override FieldAdded. B. Create an event receiver that inherits SPListEventReceiver and override FieldAdding. C. Create an event receiver that inherits SPItemEventReceiver and override ItemAdded. Copyrights 2007 Selftest Engine, all rights Reserved.

Page 19 of 47 D. Create an event receiver that inherits SPItemEventReceiver and override ItemAdding. Answer: B Question No: 60 You have a Microsoft Office SharePoint Server 2007 site. You upgrade the site to SharePoint Server 2010. You need to create a Feature that prevents site collection administrators from upgrading the user interface of the site to SharePoint Server 2010. Which property should you use? Category: A. AdministrationSiteType B. AllowDesigner C. AllowMasterPageEditing D. UIVersionConfigurationEnabled Answer: D Question No: 61 You create a timer job. You need to debug the timer job. To which process should you attach the debugger? Category: A. devenv.exe B. owstimer.exe C. spucworkerprocess.exe D. w3wp.exe Answer: B Question No: 62 You need to create a Web Part that adds a term set to the current SharePoint site collection's term store. You write the following code segment. (Line numbers are included for reference only.) 01TaxonomySession?session?=?new?TaxonomySession(SPContext.Current.Site); 02TermSet?addedTerm?=?session.TermStores[0].Groups ["MyNewTermStore"].CreateTermSet(txtBoxTermSetToAdd.Text); 03? Which code segment should you add at line 03? Category: A. addedTerm.Export(); B. addedTerm.TermStore.CommitAll(); C. SPContext.Current.Site.WebApplication.Update(); D. SPContext.Current.Web.AllowUnsafeUpdates?=?true; Answer: B

Copyrights 2007 Selftest Engine, all rights Reserved.

Page 20 of 47 Question No: 63 You are creating a custom workflow action to be used in Microsoft SharePoint Designer reusable workflows. The action programmatically creates a SharePoint site named Site1 at a specific URL. The workflow actions schema file contains the following code segment. <WorkflowInfo> <Actions?Sequential="then"?Parallel="and"> <Action?Name="Create?Site" ClassName="SPDActivityDemo.CreateSite" Assembly="SPDActivityDemo,?Version=1.0.0.0, Culture=neutral,?PublicKeyToken=1a4a7a2c3215a71b" AppliesTo="all"?Category="Test"> <Parameters> <Parameter?Name="Url"?Type="System.String,?mscorlib"?Direction="In"?/> <Parameters> </Action> </Actions> </WorkflowInfo> You need to ensure that users can specify the URL property of the action in SharePoint Designer. What should you add to the schema of the action? Category: A. <?xml?version="1.0"?encoding="utf-8" > B. <Option?Name="equals"?Value="Equal"/> C. <Parameter?Name="Url"?Type="System.String,?mscorlib"?Direction="Out"?/> D. <RuleDesigner?Sentence="Create?site?at?Url?%1."> <FieldBind?Field="Url"?Text="Url?of?site"?Id="1" DesignerType="TextArea"/></RuleDesigner> Answer: D Question No: 64 You create a client application that remotely calls the Business Connectivity Services (BCS) object model. You need to create the context that will be used to request a cache refresh. Which code segment should you use? Category: A. BdcService?cCtx?=?SPFarm.Local.Services.GetValue<BdcService>(String.Empty); B. ClientContext?cCtx?=?new?ClientContext(String.Empty); C. RemoteOfflineRuntime?cCtx?=?new?RemoteOfflineRuntime(); D. RemoteSharedFileBackedMetadataCatalog?cCtx?=?new?RemoteSharedFileBackedMetadataCatalog(); Answer: C

Copyrights 2007 Selftest Engine, all rights Reserved.

Page 21 of 47 Question No: 65 You have a document library named Documents. Minor and major version management is enabled for the document library. You plan to add a document named MyFile.docx to Documents. You create a console application that contains the following code segment. (Line numbers are included for reference only.) 01using?(SPSite?site?=?new?SPSite("http://intranet")) 02?{ 03 SPList?documents?=?site.RootWeb.Lists["Documents"]; 04 FileStream?fstream?=?File.OpenRead(@"MyFile.docx"); 05 byte[]?content?=?new?byte[fstream.Length]; 06 fstream.Read(content,?0,?(int)fstream.Length); 07 fstream.Close(); 08 site.RootWeb.Files.Add (documents.RootFolder.Url?+?"/MyFile.docx",content,?true); 09 SPFile?file?=?site.RootWeb.GetFile (documents.RootFolder.Url?+?"/?MyFile.docx"); 10 file.CheckIn(string.Empty); 11? 12?} You need to ensure that all users can see the document. Which code segment should you add at line 11? Category: A. file.CanOpenFile(true); B. file.Publish(string.Empty); C. file.ReleaseLock(string.Empty); D. file.Update(); Answer: B Question No: 66 You have a list named Projects that contains a column named ClassificationMetadat a. You need to create a Web Part that updates the ClassificationMetadata value to NA for each item in the Projects list. You write the following code segment. (Line numbers are included for reference only.) 01foreach?(SPListItem?currentItem?in?SPContext.Current.Web.Lists["Projects"].Items) 02{ 03? 04} Which code segment should you add at line 03? Category: A. currentItem["ClassificationMetadata"]?=?"NA"; B. currentItem.Fields["ClassificationMetadata"].DefaultFormula?=?"NA"; C. currentItem.Fields["ClassificationMetadata"].DefaultValue?=?"NA"; D. currentItem["Value"] =?"ClassificationMetadata/NA"; Answer: A

Copyrights 2007 Selftest Engine, all rights Reserved.

Page 22 of 47 Question No: 67 You created a custom ASPX page that updates a list. The page is deployed to the _layouts folder. The page contains the following code segment. (Line numbers are included for reference only.) 01<form?id="Form1"?runat="Server"> 02<asp:Button?id="btnUpdate"?runat="server"?Text="Update"></asp:Button> 03</form> A user attempts to update the list by using the page and receives the following error message: "The security validation for this page is invalid". You need to prevent the error from occurring. Which control should you include in Form1? Category: A. EncodedLiteral B. FormDigest C. InputFormCustomValidator D. UIVersionedContent Answer: B Question No: 68 You plan to activate the Developer Dashboard. You create a command line application that contains the following code segment. (Line numbers are included for reference only.) 01SPWebService?cs?=?SPWebService.ContentService; 02cs.DeveloperDashboardSettings.DisplayLevel?=?SPDeveloperDashboardLevel.On; 03? You execute the application and discover that the Developer Dashboard fails to appear. You need to ensure that the application activates the Developer Dashboard. What should you do? Category: A. Add the following line of code at line 03.cs.Update(); B. Add the following line of code at line 03.cs.DeveloperDashboardSettings.Update(); C. Change line 02 to the following code segment.cs.DeveloperDashboardSettings.DisplayLevel?=? SPDeveloperDashboardLevel.Off; D. Change line 02 to the following code segment.cs.DeveloperDashboardSettings.DisplayLevel?=? SPDeveloperDashboardLevel.OnDemand; Answer: B Question No: 69 You create a custom list named Products. You need to perform a Representational State Transfer (REST) query that returns the first product in the list. Which URL should you use? Category: A. http://intranet/_vti_bin/ListData.svc/Products(1) B. http://intranet/_vti_bin/ListData.svc/Products?$filter=1 C. http://intranet/Lists/Products/AllItems.aspx?contents=1 D. http://intranet/Lists/Products/ListData.svc?$expand=1 Answer: A

Copyrights 2007 Selftest Engine, all rights Reserved.

Page 23 of 47 Question No: 70 You have one Web application that contains several SharePoint site collections. You need to create a Feature that adds a custom button to the Documents tab on the Ribbon of one site collection only. What should you do? Category: A. Create a new Feature. In a new <CommandUIDefinition> node, specify the location of Ribbon.Tabs._children. B. Create a new Feature. In a new <CommandUIDefinition> node, specify the location of Ribbon.Documents.Manage.Controls._children. C. Modify the CMDUI.xml file. In a new <CommandUIDefinition> node, specify the location of Ribbon.Tabs._children. D. Modify the CMDUI.xml file. In a new <CommandUIDefinition> node, specify the location of Ribbon.Documents.Manage.Controls._children. Answer: B Question No: 71 You have a custom user profile property named MyProperty. You need to create a Web Part that displays the value of MyProperty for the current user. Which code segment should you use? Category: A. string?profile?=?SPContext.Current.Web.Properties["CurrentUser/MyProperty"]; B. string?profile?=?SPContext.Current.Web.Users["MyProperty"].ToString(); C. UserProfileManager?profileManager?=?new?UserProfileManager(SPServiceContext.Current);UserProfile? userProfile?=?profileManager.GetUserProfile(SPContext.Current.Web.CurrentUser.LoginName);string?profile?=? userProfile["MyProperty"].ToString(); D. UserProfileManager?profileManager?=?new?UserProfileManager(SPServiceContext.Current);UserProfile? userProfile?=?profileManager.GetUserProfile(SPContext.Current.Web.CurrentUser.LoginName);string?profile?=? userProfile.Properties.GetPropertyByName("MyProperty").ToString(); Answer: C Question No: 72 You create a Feature. You need to add an item to the context menu of a list. Which type of element should you use? Category: A. a CustomAction B. a ListInstance C. a ListTemplate D. a Module Answer: A Question No: 73 You need to disable the CriticalExceptionCount measure for all user solutions. You write the following code segment. (Line numbers are included for reference only.) 01SPUserCodeService?userCode?=?SPUserCodeService.Local; 02SPResourceMeasureCollection?measures?=?userCode.ResourceMeasures; 03SPResourceMeasure?measure?=?measures["CriticalExceptionCount"]; 04? 05measure.Update(); Which code segment should you add at line 04? Category: A. measure.AbsoluteLimit?=?0; Copyrights 2007 Selftest Engine, all rights Reserved.

Page 24 of 47 B. measure.AbsoluteLimit?=?1; C. measure.ResourcesPerPoint?=?0; D. measure.ResourcesPerPoint?=?1; Answer: C Question No: 74 You create a console application to manage Personal Sites. The application contains the following code segment. (Line numbers are included for reference only.) 01SPSite?siteCollection?=?new?SPSite("http://moss"); 02UserProfileManager?profileManager?=?new?UserProfileManager (ServerContext.GetContext(siteCollection)); 03UserProfile?profile?=?profileManager.GetUserProfile("domain\\username"); 04SPSite?personalSite?=?profile.PersonalSite; 05? 06siteCollection.Dispose(); You deploy the application to a SharePoint site. After deploying the application, users report that the site loads slowly. You need to modify the application to prevent the site from loading slowly. What should you do? Category: A. Remove line 06. B. Add the following line of code at line 05.personalSite.close(); C. Add the following line of code at line 05.personalSite.Dispose(); D. Change line 06 to the following code segment.siteCollection.close(); Answer: C Question No: 75 You need to create a Web Part that displays all of the permission levels of the current subsite. Which collection should you use? Category: A. SPContext.Current.Web.Permissions B. SPContext.Current.Web.Properties C. SPContext.Current.Web.RoleAssignments D. SPContext.Current.Web.RoleDefinitions Answer: D Question No: 76 You need to programmatically add a user named User1 to a group named Group1. You write the following code segment. (Line numbers are included for reference only.) 01string?login?=?"User1";? 02string?grpName?=?"Group1";? 03SPUser?user?=?SPContext.Current.Web.EnsureUser(login); 04SPGroup?group?=?SPContext.Current.Web.Groups[grpName]; 05? 06group.Update(); Which code segment should you add at line 05? Category: A. group.AddUser(user); B. group.Owner?=?user; C. user.AllowBrowseUserInfo?=?true; Copyrights 2007 Selftest Engine, all rights Reserved.

Page 25 of 47 D. user.Update(); Answer: A Question No: 77 You are creating a Web Part for SharePoint Server 2010. The Web Part contains the following code segment. (Line numbers are included for reference only.) 01 protected?override?void?CreateChildControls() 02 { 03 base.CreateChildControls(); 04 SPSecurity.RunWithElevatedPrivileges( 05 delegate 06 { 07 Label?ListCount?=?new?Label(); 08 ListCount.Text?=?String.Format ("There?are?{0}?Lists",?SPContext.Current.Web.Lists.Count); 09 Controls.Add(ListCount); 10 }); 11 } You need to identify which line of code prevents the Web Part from being deployed as a sandboxed solution. Which line of code should you identify? Category: A. 03 B. 04 C. 08 D. 09 Answer: B Question No: 78 You need to convert a user control named Control.ascx to a SharePoint Web Part. The Web Part must be packaged as a user solution. What should you do? Category: A. Modify the SafeControls section of the web.config file. B. Copy the Control.ascx file to the ControlTemplates folder. C. Create a new Visual Web Part and use the existing MyControl.ascx file. D. Create a new Web Part and reuse the code from the MyControl.ascx file. Answer: D Question No: 79 You need to create a custom content type and specify the content type ID. What should you do? Category: A. Create a new module. B. Create a custom Feature. C. Call the Lists Web service. D. Call the Webs Web service. Answer: B

Copyrights 2007 Selftest Engine, all rights Reserved.

Page 26 of 47 Question No: 80 You have a SharePoint site. The current master page of the site is v4.master. You create a custom master page named MyMasterPage.master. You deploy the master page to /_catalogs/masterpage/. You need to apply the custom master page to only the content pages of the site. What should you do? Category: A. Rename the custom master page as v4.master and overwrite /_catalogs/masterpage/v4.master. B. Rename the custom master page as v4.master and overwrite \14\TEMPLATE\GLOBAL\v4.master. C. Set the MasterUrl property and CustomMasterUrl property of the site to /_catalogs/masterpage/MyMasterPage.master. D. In the @Page directive of each page layout, set the MasterPageFile attribute to /_catalogs/masterpage/MyMasterPage.master. Answer: C Question No: 81 You create a Feature named Feature1. Feature1 is activated in a SharePoint site. You create a Web Part that contains the following code. SPSite?site?=?new?SPSite("http://intranet/site1"); SPWeb web?=?site.OpenWeb(); SPFeatureDefinition feature?= SPFarm.Local.FeatureDefinitions["Feature1"]; You need to modify the Web Part to activate Feature1 in Site1 only. Which code segment should you add to the Web Part? Category: A. site.Features.Add(feature.Id); B. site.WebApplication.WebService.Features.Add(feature.Id); C. web.Features.Add(feature.Id); D. web.Site.WebApplication.WebService.Features.Add(feature.Id); Answer: A Question No: 82 You create a modal dialog that displays a list of items. You need to capture the items selected by a user. Which code segment should you use? Category: A. SPItem?item?=?SPContext.Current.Item; B. var?items?=?SP.ListOperation.Current.Item();? C. var?items?=?SP.ListOperation.Selection.getSelectedItems(); D. var?item?=?SPContext.Current.Item["Selected"] Answer: C Question No: 83 You have a SharePoint solution that contains a custom site column and a custom content type. You need to add the custom site column as a lookup field for the custom content type. What should you create? Category: A. a Feature activation dependency B. a new Feature event receiver C. a new module Copyrights 2007 Selftest Engine, all rights Reserved.

Page 27 of 47 D. a new SharePoint mapped folder Answer: B Question No: 84 You create a custom workflow by using Microsoft Visual Studio 2010. You need to specify a custom InfoPath workflow initiation form in the workflow element manifest file. Which attribute should you configure? Category: A. Association_FormURN B. Instantiation_FieldML C. Instantiation_FormURN D. InstantiationUrl Answer: C Question No: 85 You create a Microsoft .NET Framework console application that uses a Representational State Transfer (REST) API to query a custom list named Products. The application contains the following code segment. AdventureWorksDataContext?codc?=?new?AdventureWorksDataContext (new?Uri("http://contoso/_vti_bin/listdat a.svc")); codc.Credentials?=?CredentialCache.DefaultCredentials; You need to read all items in Products into an object. Which method should you use? Category: A. codc.Products.All B. codc.Products.AsQueryable C. codc.Products.ElementAt D. codc.Products.ToList Answer: D Question No: 86 You update a solution validator. You need to ensure that all SharePoint solutions are validated the next time the solutions are executed. What should you do? Category: A. Modify the Guid attribute of the solution validator. B. Deactivate and activate all of the installed solutions. C. Modify the Signature property of the solution validator. D. In the Feature that deploys the solution validator, modify the Version attribute of the Feature element. Answer: C

Copyrights 2007 Selftest Engine, all rights Reserved.

Page 28 of 47 Question No: 87 You add a delegate control to the <head> section of a custom master page. You reference a default script file by using the delegate control. You need to ensure that the delegate control meets the following requirements: Prevents other developers from deleting the default script reference .Provides developers with the ability to add additional script references .Provides developers with the ability to change the order of the script references Which property should you use? Category: A. AllowMultipleControls B. BindingContainer C. Scope D. Template_Controls Answer: A Question No: 88 You create a Web Part that calls a function named longCall. You discover that longCall takes a long time to execute. You need to display in the Developer Dashboard how long it takes to execute longCall. Which code segment should you use? Category: A. DateTime?startTime?=?DateTime.Now;longCall();Trace.Write("Long?Call?"?+?DateTime.Now.Subtract (startTime).Seconds); B. DateTime?startTime?=?DateTime.Now;longCall();Trace.TraceWarning("Long?Call?"?+? DateTime.Now.Subtract(startTime).Seconds); C. Monitor.Enter("Long?Call");{ longCall();}Monitor.Exit("Long?Call"); D. using?(SPMonitoredScope?monitoredScope?=?new?SPMonitoredScope("Long?Call"))?{ longCall();} Answer: D Question No: 89 You have a SharePoint site collection that contains 100 sites. Each site contains 100 lists. You need to retrieve the data from all of the lists. The data must be retrieved in the minimum amount of time. Which access method should you use? Category: A. ListData.svc B. SPListItemCollection.GetDataTable C. SPList.Items D. SPSiteDataQuery Answer: D Question No: 90 You are creating a Web Part in SharePoint Server 2010. You need to ensure that the Web Part can send data to another Web Part. Which interface should you override? Category: A. IQueryable B. ISerializable C. IWebEditable

Copyrights 2007 Selftest Engine, all rights Reserved.

Page 29 of 47 D. IWebPartField Answer: D Question No: 91 You are creating an application page that will open a dialog box. The dialog box uses a custom master page. You write the following code segment. (Line numbers are included for reference only.) 01<script?type="text/javascript"> 02 function?DialogCallback(dialogResult,?returnValue){} 03 function?OpenEditDialog(id){? 04 var?options?=?{? url:"http://intranet/_layouts/MsgToShow.aspx, width:?300,? 05 height:?300,? 06 dialogReturnValueCallback:?DialogCallback? 07 };? 08 SP.UI.ModalDialog.showModalDialog(options);? 09 } 10</script> You need to ensure that the code opens the dialog box. What should you do? Category: A. Add a script link that references SP.js. B. Add a script link that references SharePoint.Dialog.js. C. At line 08, change showModalDialog to openDialog. D. At line 08, change showModalDialog to commonModalDialogOpen. Answer: A Question No: 92 You have a custom master page named MyApplication.master. You need to apply MyApplication.master to only a custom application page in a SharePoint site. You must achieve the goal by using the minimum amount of effort. What should you do? Category: A. Add a custom HTTP module to the Web application that modifies the master page. B. Add a custom HTTP module to the Web application that modifies the custom application page. C. Set the MasterPageFile attribute to ~/_layouts/MyApplication.master in the @Page directive of the custom application page. D. Rename the custom application page as application.master and overwrite the default application.master page in the 14\TEMPLATE\LAYOUTS folder. Answer: C Question No: 93 You need to send a single value from a consumer Web Part to a provider Web Part. Which interface should you use? Category: A. IAlertNotifyHandler B. IWebPartField C. IWebPartParameters D. IWebPartRow Answer: C

Copyrights 2007 Selftest Engine, all rights Reserved.

Page 30 of 47 Question No: 94 You have a Web Part that contains the following code segment. (Line numbers are included for reference only.) 01protected?void?Page_Load(object?sender,?EventArgs?e) 02{ 03 SPSite?site?=?new?SPSite("http://www.contoso.com/default.aspx"); 04 { 05 SPWeb?web?=?site.OpenWeb(); 06? 07 } 08 09} You deploy the Web Part to a SharePoint site. After you deploy the Web Part, users report that the site loads slowly. You need to modify the Web Part to prevent the site from loading slowly. What should you do? Category: A. Add the following line of code at line 06.web.Close(); B. Add the following line of code at line 06.web.Dispose(); C. Add the following line of code at line 08.site.Close(); D. Change line 03 to the following code segment.using?(SPSite?site?=?new?SPSite ("http://www.contoso.com/default.aspx")) Answer: D Question No: 95 You have a Web Part that causes an error. You need to ensure that you can view the trace history in the Trace.axd file. What should you configure in the web.config file? Category: A. In the <system.web> element, add the following line of code.<trace?enabled="true"?localOnly="true"? pageOutput="false" /> B. In the <SafeMode> element, configure the following attributes.CallStack="true"AllowPageLevelTrace="true" C. In the <SafeMode> element, configure the following attributes.CallStack="false"AllowPageLevelTrace="true" D. In the <system.web> element, configure the following element.<trace?enabled="false"?localOnly="true"? pageOutput="true" />In the <SafeMode> element, configure the following attribute.AllowPageLevelTrace="true" Answer: A Question No: 96 You need to add a modal dialog box to a SharePoint application. What should you use? Category: A. the Core.js JavaScript B. the Microsoft.SharePoint assembly C. the Microsoft.SharePoint.Client assembly D. the SP.js JavaScript Answer: D

Copyrights 2007 Selftest Engine, all rights Reserved.

Page 31 of 47 Question No: 97 You create a Web Part that contains the following logging code. (Line numbers are included for reference only.) 01SPWeb web = SPContext.Current.Web; 02try 03{ 04 ... 05} 06catch(Exception?ex)? 07{ 08? 09 System.Diagnostics.EventLog.WriteEntry("WebPart?Name", "Exception?Information:?"?+?ex.Message,?EventLogEntryType.Error); 10} You discover that line 09 causes an error. You need to resolve the error. What should you do? Category: A. Run the code segment at line 09 inside a RunWithElevatedPrivileges delegate. B. Add the following code at line 08.if?(web.CurrentUser.IsSiteAuditor?==?false) C. Add the following code at line 08.if?(web.CurrentUser.IsSiteAdmin?==?false) D. Change line 09 to the following code segment.System.Diagnostics.EventLog.WriteEntry("WebPart? Name",?"Exception?Information",?EventLogEntryType.Error); Answer: A Question No: 98 You have a SharePoint site that uses the default search settings. You create a new Search Center. You need to ensure that the new Search Center is the default Search Center for the site. What should you modify? Category: A. the AllProperties collection of the site B. the AllWebs collection of the site collection C. the Cache property of the current HttpContext D. the Session property of the current HttpContext Answer: A Question No: 99 You are developing a custom Feature by using Microsoft Visual Studio 2010. You need to ensure that when you deploy the Feature, a file named Form1.xsn is deployed to the Feature folder. You must achieve this goal by using the minimum amount of development effort. What should you do? Category: A. Add a new module to the Visual Studio project. B. Add a Feature receiver to the Visual Studio project. C. Configure the Properties element in the Feature definition file. D. Configure the ActivationDependencies element in the Feature definition file. Answer: A

Copyrights 2007 Selftest Engine, all rights Reserved.

Page 32 of 47 Question No: 100 You need to create a timer job that queries a list. What should you do? Category: A. Create a class that inherits SPJobDefinition and override the Execute method. B. Create a class that inherits SPJobDefinition and override the Provision method. C. Create a class that inherits SPServiceApplication and override the Provision method. D. Create a class that inherits SPServiceApplication and override the ProvisionInstances method. Answer: A Question No: 101 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? Category: A. Modify the DocIdRedir.aspx page. B. Modify the Onet.xml file of the site. C. Register a class that derives from DocumentId. D. Register a class that derives from DocumentIdProvider. Answer: D Question No: 102 You have a helper method named CreateSiteColumn that contains the following code segment. 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? Category: A. SPField?field?=?new?SPFieldChoice(web.Lists[0].Fields,?columnName); B. web.Fields.Add(columnName,?SPFieldType.Choice,?true); C. web.Lists[0].Fields.Add(columnName,?SPFieldType.Choice,?true); D. web.Lists[0].Views[0].ViewFields.Add(columnName); Answer: B Question No: 103 You have a Feature named Feature1. You plan to create a new version of Feature1 that will upgrade the existing version of Feature1. You need to ensure that when Feature1 is upgraded, additional configuration data is added to the property bag of the site. What should you do? Category: A. Add a <CustomUpgradeAction> element and increase the Version number of the Feature. B. Add a <CustomUpgradeAction> element and increase the UIVersion number of the Feature. C. Add an <ActivationDependencies> element and increase the Version number of the Feature.

Copyrights 2007 Selftest Engine, all rights Reserved.

Page 33 of 47 D. Add an <ActivationDependencies> element and increase the UIVersion number of the Feature. Answer: A Question No: 104 You create a custom field type and a CustomFieldControl.ascx user control. You need to write the code-behind of the CustomFieldControl.acsx user control. Which object should you override? Category: A. BaseFieldControl B. SPFieldCalculated C. SPFieldText D. WebPart Answer: A Question No: 105 You have a SharePoint farm that has more than 100 custom Features. You upgrade several Features in the farm. You need to ensure that the site collection uses the most up-to-date versions of the Features. Only Features that require an upgrade must be evaluated. Which code segment should you use? Category: A. SPFeatureQueryResultCollection?queryResults?=?myWebService.QueryFeatures(SPFeatureScope.Site,? true);IEnumerator<SPFeature>?featureEnumerator?=?queryResults.GetEnumerator();while? (featureEnumerator.MoveNext()){ SPFeature?feature?=?featureEnumerator.Current; feature.Upgrade(false);} B. SPFeatureQueryResultCollection?queryResults?=?myWebService.QueryFeatures(SPFeatureScope.Web,? true);IEnumerator<SPFeature>?featureEnumerator?=?queryResults.GetEnumerator();while? (featureEnumerator.MoveNext()){ SPFeature?feature?=?featureEnumerator.Current; feature.Upgrade(false);} C. SPSite?site?=?SPContext.Current.Site;SPFeatureCollection?allFeatures?=?site.Features;foreach? (SPFeature?currentFeature?in?allFeatures){ currentFeature.Upgrade(true);} D. SPWeb?web?=?SPContext.Current.Web;SPFeatureCollection?allFeatures?=?web.Features;foreach? (SPFeature?currentFeature?in?allFeatures){ currentFeature.Upgrade(true);} Answer: A Question No: 106 You create a user control named MySearchBox.ascx. You plan to change the native search control in SharePoint to MySearchBox.ascx. You implement a Feature that contains the following code segment. <Control?Id="SmallSearchInputBox" Sequence="100" ControlSrc="~/_controltemplates/MySearchBox/?MySearchBox.ascx"> </Control> You discover that the MySearchBox.ascx control fails to appear. You need to ensure that the MySearchBox.ascx control appears. What should you do? Category: A. Add the ControlClass attribute. B. Add the ControlAssembly attribute. C. Modify the Sequence attribute value. D. Remove the ControlSrc attribute value. Answer: C

Copyrights 2007 Selftest Engine, all rights Reserved.

Page 34 of 47 Question No: 107 You need to create a Web Part that creates a copy of the out-of-the box Contribute permission level. Which code segment should you implement in the Web Part? Category: A. SPRoleDefinition?myRole?=?new?SPRoleDefinition();myRole.Name? =?"Contribute";SPContext.Current.Web.RoleDefinitions.Add(myRole); B. SPRoleDefinition?myRole?=?new?SPRoleDefinition(SPContext.Current.Web.RoleDefinitions ["Contribute"]);myRole.Name?=?"MyContribute";SPContext.Current.Web.RoleDefinitions.Add(myRole); C. SPRoleDefinition?myRole?=?new?SPRoleDefinition(SPContext.Current.Web.RoleDefinitions ["MyContribute"]);myRole.Description?=?"Contribute";SPContext.Current.Web.RoleDefinitions.Add(myRole); D. SPRoleDefinition?myRole?=?new?SPRoleDefinition(SPContext.Current.Web.RoleDefinitions ["MyContribute"]);myRole.Name?=?"Contribute";SPContext.Current.Web.RoleDefinitions.Add(myRole); Answer: B Question No: 108 You create a Visual Web Part in SharePoint Server 2010. You need to ensure that the Web Part can access the local file system on the SharePoint server. You must minimize the amount of privileges assigned to the Web Part. What should you do? Category: A. Elevate the trust level to Full. B. Elevate the trust level to WSS_Medium. C. Create a custom code access security (CAS) policy. D. Deploy the Web Part to the Global Assembly Cache (GAC). Answer: C Question No: 109 You create a SharePoint solution. You deploy the SharePoint solution by using Microsoft Visual Studio 2010. You need to prevent the Feature that is contained in the solution from being automatically activated when you deploy the solution. What should you configure in Visual Studio 2010? Category: A. the active deployment configuration B. the build configuration C. the pre-deployment command line D. the startup item Answer: A Question No: 110 You create a user solution that contains a Web Part. You need to debug the Web Part by using Microsoft Visual Studio 2010. To which process should you attach the debugger? Category: A. owstimer.exe B. spucworkerprocess.exe C. spucworkerprocessproxy.exe D. w3wp.exe Answer: B Copyrights 2007 Selftest Engine, all rights Reserved.

Page 35 of 47 Question No: 111 You plan to create a custom approval workflow. The workflow approvers will enter their employee number in the edit task form. You need to ensure that the onTaskChanged1_Invoked method of the workflow retrieves the value of the employee number. Which object should you use? Category: A. SPWorkflowActivationProperties.Item B. SPWorkflowActivationProperties.TaskListId C. SPWorkflowTaskProperties.ExtendedProperties D. SPWorkflowTaskProperties.Properties Answer: C Question No: 112 You need to create a Web control that displays an ASCX control. Which event should you use to render the Web control? Category: A. CreateChildControls B. LoadControlState C. SaveViewState D. SetDesignModeState Answer: A Question No: 113 You create a Web Part. The Web Part contains a grid view named GridView1 and the following code segment. (Line numbers are included for reference only.) 01IntranetDataContext?dc?=?new?IntranetDataContext?("http://intranet"); 02MyGridView.DataSource?=?from?announce?in?dc.Announcements 03? 04select?announce; IntranetDataContext is a LINQ context. You need to ensure that GridView1 only displays items from Announcements that have an expiry date that is greater than or equal to the current date. What should you do? Category: A. Change line 04 to the following code segment.select?!announce.Expires.HasValue B. Change line 04 to the following code segment.select?announce.Expires.Value.CompareTo(DateTime.Now)? >=?0 C. Add the following line of code at line 03.where?announce.Expires.Value.CompareTo(DateTime.Now)?>=?0 D. Add the following line of code at line 03.orderby?announce.Expires.Value.CompareTo(DateTime.Now)?>=?0 Answer: C

Copyrights 2007 Selftest Engine, all rights Reserved.

Page 36 of 47 Question No: 114 You create a user control named MySearch.ascx. You plan to change the native search control in SharePoint to MySearch.ascx. You need to provide the site administrator with the ability to change the out-of-the-box search control to MySearch.ascx. What should you do? Category: A. Configure the SearchBox.dwp in the Web Part gallery. B. Override the search delegate control by using a Feature. C. Modify the <SafeControls> element in the web.config file. D. Modify \14\TEMPLATE\FEATURES\SearchWebParts\SearchBox.dwp. Answer: B Question No: 115 You create a Web Part that takes three values from three text boxes and creates a new SharePoint site when you click a button named CreateNewSite. The Web Part contains the following code segment. protected?void?CreateNewSite_Click(object?sender,?EventArgs?e) { SPSite site = SPContext.Current.Site; SPWeb?web?=?site.AllWebs.Add(SiteNameTextBox.Text,?SiteTitleTextBox.Text, SiteDescriptionTextBox.Text,?0,?SPWebTemplate.WebTemplateSTS,?false,?false); } You test the Web Part and it works properly. When another user attempts to use the Web Part to create a new site, he receives the following error message: "Error: Access Denied." You need to ensure that users can use the Web Part to create new sites. What should you do? Category: A. Add web.Update() after the code segment. B. Add web.ValidatesFormDigest() after the code segment. C. Run the code segment inside a SPSecurity.RunWithElevatedPrivileges delegate. D. Add the following code after the code segment.SPUser?currentUser?=?web.CurrentUser;web.Users.Add (currentUser.LoginName,?currentUser.Email,?currentUser.Name,?""); Answer: C Question No: 116 You create a SharePoint solution that contains two Features named Feature1 and Feature2. You need to ensure that Feature1 is always activated before Feature2. You must achieve this goal by using the minimum amount of development effort. What should you do? Category: A. Create a custom Feature receiver for Feature1. B. Create a custom Feature receiver for Feature2. C. From Feature1.feature explorer, add Feature2 to the Feature Activation Dependencies list. D. From Feature2.feature explorer, add Feature1 to the Feature Activation Dependencies list. Answer: D

Copyrights 2007 Selftest Engine, all rights Reserved.

Page 37 of 47 Question No: 117 You have several SharePoint sites. You plan to load a custom script in all pages of the sites. You need to ensure that you can activate or deactivate the script at the site level. What should you do? Category: A. Create a site definition and modify the CustomJSUrl attribute in the Onet.xml file. B. Create a site definition and modify the <system.web> element in the web.config file. C. Create a user control that contains the script. Create a Feature that overrides the ControlArea delegate control. D. Create a user control that contains the script. Create a Feature that overrides the AdditionalPageHead delegate control. Answer: D Question No: 118 You create a workflow named WF1. WF1 is attached to a list named List1. You need to receive an e-mail notification if WF1 is postponed. What should you do? Category: A. Use a ReceiveActivity activity in WF1. B. Use a HandleExternalEvent activity in WF1. C. Attach an SPItemEventReceiver event receiver to List1. D. Attach an SPWorkflowEventReceiver event receiver to List1. Answer: D Question No: 119 You create a list named List1. You create two workflows named WF1 and WF2 for List1. You need to ensure that when a new item is created in List1, WF1 starts automatically. WF2 must start automatically after WF1 completes. What should you do? Category: A. Add a Replicator activity to WF2. B. Add a SendActivity activity to WF2. C. Create a SPWebEventReceiver event receiver. D. Create a SPWorkflowEventReceiver event receiver. Answer: D Question No: 120 You need to add a new field to a provisioned content type. You must propagate the field to child lists and child content types. What should you use? Category: A. <AddContentTypeField> B. <ApplyElementManifests> C. <FieldRefs> D. <MapFile> Answer: A Copyrights 2007 Selftest Engine, all rights Reserved.

Page 38 of 47 Question No: 121 You have a Feature that contains an image named ImageV1.png. You plan to create a new version of the Feature. You need to ensure that when the Feature is upgraded, the image is renamed as ImageV2.png. You must achieve this goal by using the minimum amount of development effort. Which element should you configure in the Feature definition file? Category: A. <ApplyElementManifests> B. <CustomUpgradeAction> C. <MapFile> D. <VersionRange> Answer: C Question No: 122 You create a custom Web Part. You need to verify whether the Web Part causes any memory leaks. Which tool should you use? Category: A. SPDisposeCheck.exe B. SPMetal.exe C. Wca.exe D. WinDbg.exe Answer: A Question No: 123 You develop a new publishing page layout named MyPage.aspx for a SharePoint site. You create an Elements.xml file. Elements.xml contains the following code segment. (Line numbers are included for reference only.) 01<File?Url="mypage.aspx"?Type="GhostableInLibrary"?IgnoreIfAlreadyExists="TRUE"> 02<Property?Name="Title"?Value="MyPage"?/> 03<Property?Name="ContentType"?Value="$Resources:cmscore,contenttype_pagelayout_name;"?/>? 04<Property?Name="PublishingAssociatedContentType"?Value="; 05 #$Resources:cmscore,contenttype_page_name;; 06 #0x01010007FF3E057FA8AB4AA42FCB67B453FFC100E214EEE741181F4E9F7ACC43278EE811;#"/> 07? 08</File> You need to prevent users from creating pages based on the page layout. Which property tag should you add at line 07? Category: A. <Property?Name="Hidden"?Value="True"?/> B. <Property?Name="PublishingHidden"?Value="True"?/> C. <Property?Name="RequireSiteAdministrator"?Value="False" /> D. <Property?Name="Rights"?Value="ViewListItems"?/> Answer: B

Copyrights 2007 Selftest Engine, all rights Reserved.

Page 39 of 47 Question No: 124 You plan to create two Web Parts named Products and ProductDetails. You create an interface that contains the following code segment. Public?interface?Interface1 { String?Productid?{?get;?} } You need to ensure that the Products Web Part sends Productid to the ProductDetails Web Part. You must achieve this goal by using the ASP.NET Web Part connection framework. What should you do? Category: A. Implement Interface1 in the Products Web Part. B. Implement Interface1 in the ProductDetails Web Part. C. Add a private set-accessor-declaration to the Productid property. D. Add a protected set-accessor-declaration to the Productid property. Answer: A Question No: 125 You are creating a custom workflow action that will be used in Microsoft SharePoint Designer reusable workflows. The action will programmatically create a SharePoint site named Site1 at a specific URL. You need to ensure that users can specify the URL of Site1 in the action. What should you use? Category: A. the DependencyProperty class B. the OnWorkflowActivated.WorkflowProperties property C. the SPPersistedObject class D. the SPWorkflowActivationProperties.InitiationData property Answer: A Question No: 126 You have a timer job that has the following constructors. (Line numbers are included for reference only.) 01public?TimerJob1?()?:?base()?{?} 02public?TimerJob1(SPWebApplication?wApp) You need to ensure that the timer job runs on the first available timer server only. Which base class constructor should you use at line 02? Category: A. base(null,?wApp,?null,?SPJobLockType.ContentDatabase){} B. base(null,?wApp,?null,?SPJobLockType.Job){} C. base(null,?wApp,?null,?SPJobLockType.None){} D. base("TimerJob1",?wApp,?null,?SPJobLockType.None){} Answer: B

Copyrights 2007 Selftest Engine, all rights Reserved.

Page 40 of 47 Question No: 127 You have a SharePoint site collection. The root Web of the site collection has the URL http://intranet. You plan to create a user solution that will contain a Web Part. The Web Part will display the title of the root Web. You write the following code segment for the Web Part. (Line numbers are included for reference only.) 01SPSite?currentSite?=?new?SPSite("http://intranet"); 02? 03Label?currentTitle?=?new?Label(); 04currentTitle.Text?=?currentSite.RootWeb.Title; You add the Web Part to a page in the root Web and receive the following error message: "Web Part Error: Unhandled exception was thrown by the sandboxed code wrapper's Execute method in the partial trust app domain: An unexpected error has occurred." You need to prevent the error from occurring. What should you do? Category: A. Add the following line of code at line 02.currentSite.OpenWeb(); B. Add the following line of code at line 02.currentSite.OpenWeb("http://intranet"); C. Change line 01 to the following code segment.SPSite?currentSite?=?SPContext.Current.Site; D. Change line 04 to the following code segment.currentTitle.Text?=?currentSite.OpenWeb().Title; Answer: C Question No: 128 You have a SharePoint list named Announcements. You have an event receiver that contains the following code segment. (Line numbers are included for reference only.) 01public?override?void?ItemAdding(SPItemEventProperties?properties) 02 { 03 if?(properties.ListItem["Title"].ToString().Contains("secret")) 04? 05} You need to prevent users from adding items that contain the word "secret" in the title to the list. Which code segment should you add at line 04? Category: A. properties.Cancel?=?false; B. properties.Cancel?=?true; C. properties.Status = SPEventReceiverStatus.Continue; D. return; Answer: B

Copyrights 2007 Selftest Engine, all rights Reserved.

Page 41 of 47 Question No: 129 You have a Microsoft .NET Framework console application that uses the SharePoint client object model. The application contains the following code segment. (Line numbers are included for reference only.) 01ClientContext?cCtx?=?new?ClientContext("http://intranet/hr"); 02List?sharedDocList?=?cCtx.Web.Lists.GetByTitle("Shared?Documents"); 03CamlQuery?camlQuery?=?new?CamlQuery(); 04camlQuery.ViewXml?= 05@"<View> 06 <Query> 07 <Where> 08 <Eq> 09? 10 <Value?Type='Text'>Doc1.docx</Value> 11 </Eq> 12 </Where> 13 </Query> 14</View>"; 15ListItemCollection?docLibItems?=?sharedDocList.GetItems(camlQuery); 16cCtx.Load(sharedDocList); 17cCtx.Load(docLibItems); 18cCtx.ExecuteQuery(); You need to ensure that the application queries Shared Documents for a document named Doc1.docx. Which code element should you add at line 09? Category: A. <FieldRef?Name='FileDirRef'/> B. <FieldRef?Name='FileLeafRef'/> C. <FieldRef?Name='FileRef'/> D. <FieldRef?Name='File_x0020_Type'/> Answer: B Question No: 130 You create a custom Web Part. You need to create a class to log Web Part errors to the Unified Logging Service (ULS) logs. What should you use? Category: A. the ILogger interface B. the ILoggingProvider interface C. the SPDiagnosticsServiceBase class D. the SPPersistedObject class Answer: C Question No: 131 You create a Visual Web Part. You need to add an image to the Web Part. The image must be deployed to the 14\TEMPLATE\IMAGES folder. What should you do in Microsoft Visual Studio? Category: A. Create a folder named Images. B. Create a folder named _layouts and a subfolder named Images. C. Add a SharePoint Images mapped folder. D. Add a SharePoint Layouts mapped folder and create a subfolder named Images. Answer: C Copyrights 2007 Selftest Engine, all rights Reserved.

Page 42 of 47 Question No: 132 You create a custom workflow action named WF1 that copies the content of one a document library to another document library. WF1 is used in a Microsoft SharePoint Designer reusable workflow. You need to ensure that the workflow action is deployed as a sandboxed solution. Where should you define the workflow action? Category: A. the Elements.xml file B. the ReplicatorActivity activity C. the SPPersistedObject object D. the WF1.actions file Answer: A Question No: 133 You create a custom Web Part. You need to ensure that a custom property is visible in Edit mode. Which attribute should you set in the Web Part? Category: A. Personalizable B. WebBrowsable C. WebCategoryName D. WebDisplayName Answer: B Question No: 134 You develop a custom approval workflow. The workflow uses the CreateTask class to assign tasks to a user named User1. A list called Tasks stores the tasks. Other workflows and users use the Tasks list. You need to ensure that the tasks assigned to User1 can only be viewed by User1. What should you do? Category: A. Set the CreateTask.TaskProperties property. B. Set the CreateTask.SpecialPermissions property. C. Break the permission inheritance for the Tasks list. D. Assign a custom permission level to a group that contains User1. Answer: B Question No: 135 You create a SharePoint solution by using Microsoft Visual Studio 2010. The SharePoint solution contains a third -party assembly. You need to deploy the third-party assembly to the Global Assembly Cache (GAC). What should you use? Category: A. a SharePoint mapped folder B. the active deployment configuration C. the Feature Designer

Copyrights 2007 Selftest Engine, all rights Reserved.

Page 43 of 47 D. the Package Designer Answer: D Question No: 136 You create a Web Part that queries a list. The Web Part contains the following code segment. (Line numbers are included for reference only.) 01protected?override?void?Render(HtmlTextWriter?writer) 02{ 03 SPUserToken?spInToken?=?GetTheContext(SPContext.Current.Site); 04 using?(SPSite?aSite?=?new?SPSite(curSiteCtx.ID,?spInToken)) 05 { 06 ... 07 } 08} 09private?SPUserToken?GetTheContext(SPSite?nWeb) 10{ 11 nWeb.CatchAccessDeniedException?=?false; 12 SPUserToken?spToken?=?null; 13 try 14 { 15 spToken =?nWeb.SystemAccount.UserToken; 16 } 17 catch?(UnauthorizedAccessException) 18 { 19? 20 } 21 return?spToken; 22} You need to ensure that users without permissions to the list can view the contents of the list from the Web Part. Which code segment should you add at line 19? Category: A. SPSecurity.RunWithElevatedPrivileges(delegate(){ using?(SPSite?eSite?=?new?SPSite(nWeb.ID)) { spToken =?nWeb.SystemAccount.UserToken; }}); B. SPSecurity.RunWithElevatedPrivileges(delegate(){ using?(SPSite?eSite?=?new?SPSite(nWeb.ID)) { spToken?=?SPContext.Current.Web.CurrentUser.UserToken; }}); C. spToken?=?nWeb.RootWeb.AllUsers[SPContext.Current.Web.Name].UserToken; D. spToken?=?nWeb.RootWeb.AllUsers[WindowsIdentity.GetCurrent().Name].UserToken; Answer: A Question No: 137 You have a Web page named ShowMessage.aspx. You create a new Web page. You need to display the content from ShowMessage.aspx in an IFRAME on the new Web page. You must achieve this goal by using the minimum amount of effort. What should you do? Category: A. Add a FormView Web Part that displays ShowMessage.aspx. B. Use Response.Write to write text to the browser. C. Use SP.UI.ModalDialog.showModalDialog() to display a dialog. D. Use Response.Redirect to send users to the ShowMessage.aspx page. Answer: C

Copyrights 2007 Selftest Engine, all rights Reserved.

Page 44 of 47 Question No: 138 You plan to develop a Web Part that displays a SharePoint list. The Web Part will verify the list permissions when users access by using the web.CurrentUser.DoesUserHavePermissions method. You need to ensure that when users do not have permissions to the list, the Web Part displays the company's logo. Which code segment should you add to the Web Part? Category: A. RunWithElevatedPrivileges B. web.AllowUnsafeUpdates=?true; C. web.CurrentUser.RequireRequestToken?=?false; D. web.ValidateFormDigest(); Answer: A Question No: 139 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? Category: A. SPSite?siteCollection?=?new?SPSite("http://www.contoso.com");SPWebCollection?site?=? siteCollection.AllWebs; B. SPSite?siteCollection?=?new?SPSite("http://www.contoso.com");SPWeb?site?=?siteCollection.RootWeb; C. SPSite?site?=?SPContext.Current.Site; D. SPWeb?site?=?SPContext.Current.Web; Answer: D Question No: 140 You are creating a Web Part that will be deployed as a sandboxed solution. You need to ensure that the Web Part can write debugging information to the SharePoint trace logs. Which class should the logging component inherit? Category: A. SPDelegate B. SPLog C. SPPersistedObject D. SPProxyOperation Answer: D Question No: 141 You have a SharePoint site collection. The default master page for the site collection displays a navigation bar on the left side of the page. You create a custom content page. You need to hide the navigation bar on only the custom content page. What should you do? Category: A. On the default master page, remove the ContentPlaceHolder control that has the ID PlaceHolderLeftNavBar. B. On the default master page, set the Visible attribute to False in the ContentPlaceHolder control that has the ID PlaceHolderLeftNavBar. C. Add an empty Content control to the custom content page and set the ContentPlaceHolderID attribute to PlaceHolderLeftNavBar. Copyrights 2007 Selftest Engine, all rights Reserved.

Page 45 of 47 D. Add a Content control to the custom content page, set the ContentPlaceHolderID attribute to PlaceHolderLeftNavBar, and set the Visible attribute to False. Answer: C Question No: 142 You create a custom page layout that has a field control named Field1. You need to ensure that Field1 is only visible when users modify the contents of the page. Which parent control should you use for Field1? Category: A. EditModePanel B. PageLayoutValidator C. PublishingContext D. ValidatorAggregator Answer: A Question No: 143 You need to create a Web Part that verifies whether a user who accesses the Web Part page is a member of a group named Group1. Which code condition should you use? Category: A. SPContext.Current.Web.Groups["Group1"].ContainsCurrentUser B. SPContext.Current.Web.SiteUsers[SPContext.Current.Web.CurrentUser.ID].Groups["Group1"]?!=?null C. SPContext.Current.Web.SiteUsers[SPContext.Current.Web.CurrentUser.ID].Groups["Group1"]?==?null D. SPContext.Current.Web.Users["Group1"].IsDomainGroup Answer: A Question No: 144 You create a Feature receiver. You need to hide the Quick Launch navigation bar of a SharePoint site. What should you use? Category: A. the Hidden property of each list B. the Navigation.QuickLaunch.Parent.IsVisible property C. the OnQuickLaunch property of each list D. the QuickLaunchEnabled property Answer: D Question No: 145 You have a SharePoint site collection that contains 100 subsites. You plan to create a Web Part. The Web Part will be deployed to each subsite. You need to ensure that the Web Part retrieves all of the files in the root directory of the current subsite. You write the following code segment. (Line numbers are included for reference only.) 01SPSite?site?=?SPContext.Current.Site; 02SPWeb?web?=?SPContext.Current.Web; 03?Which code segment should you add at line 03? Category: A. site.AllWebs[1].Files B. Site.RootWeb.Lists[0].Items C. web.Files Copyrights 2007 Selftest Engine, all rights Reserved.

Page 46 of 47 D. web.RootFolder.SubFolders[0].Files Answer: C Question No: 146 You have a SharePoint Web application that has the URL http://intranet. You are creating a Microsoft .NET Framework application that will display the title of the SharePoint Web application and will execute outside of the SharePoint server. You create a textbox named textBoxTitle. You write the following code segment. (Line numbers are included for reference only.) 01ClientContext?context?=?new?ClientContext("http://intranet"); 02? 03Web?site?=?context.Web; 04context.Load(site); 05? 06textBoxTitle.Text?=?site.Title; You discover that line 04 generates an error. You need to ensure that the .NET application displays the title of the SharePoint Web application in textBoxTitle. What should you do? Category: A. Add the following line of code at line 02.context.ExecuteQuery(); B. Add the following line of code at line 02.context.ValidateOnClient?=?true; C. Add the following line of code at line 05.context.ExecuteQuery(); D. Add the following line of code at line 05.context.ValidateOnClient?=?true; Answer: C Question No: 147 You plan to create one provider Web Part and two consumer Web Parts. You need to ensure that the consumer Web Parts can receive data from the provider Web Part. You create an interface that contains the following code segment. public interface Interface1 { string Parameter1 { get; } } What should you do next? Category: A. Implement Interface1 in the provider Web Part. B. Implement IWebPartField in the provider Web Part. C. Create a set accessor for Parameter1. D. Create a second interface and use it to communicate with the provider Web Part. Answer: D

Copyrights 2007 Selftest Engine, all rights Reserved.

Page 47 of 47 Question No: 148 You need to create a Web Part that displays all content created by a specific user. You write the following code segment. (Line numbers are included for reference only.) 01private?void?keywordQueryExecute(string?searchAuthor) 02{ 03 KeywordQuery?kRequest?=?new?KeywordQuery(ServerContext.Current); 04? 05 kRequest.QueryText?=?strQuery; 06 ResultTableCollection?resultTbls?=?kRequest.Execute(); 07} Which code segment should you add at line 04? Category: A. string?strQuery?=?"author:"?+?searchAuthor; B. string?strQuery?=?"docID:"?+?searchAuthor; C. string?strQuery?=?"SELECT?Title,?Rank,?Write,?Url?FROM?SCOPE()?WHERE?author?=?"?+? searchAuthor; D. string?strQuery?=?"SELECT?Title,?Rank,?Write,?Url?FROM?SCOPE()?WHERE?docID?=?"?+? searchAuthor; Answer: A Question No: 149 You have a custom Web Part. You need to create a custom user interface for modifying the Web Part properties. What should you do? Category: A. Modify the [ToolBox] attribute of the custom Web Part. B. Create a new tool part for the custom Web Part. C. Create a new Web Part. Implement the IControlBuilderAccessor interface. D. Create a new Master Page. Implement the IControlBuilderAccessor interface. Answer: B Question No: 150 You create a Web Part named WP1. You need to ensure that the name of the Web Part displays as Corporate in SharePoint. What should you do? Category: A. Rename WP1.webpart as Corporate.webpart. B. In WP1.webpart, change the Title property to Corporate. C. In the Elements.xml file, change the Name property of the <File> element to Corporate. D. In the constructor of WP1.cs, add the following line of code.Page.Title?=?"Corporate"; Answer: B

Copyrights 2007 Selftest Engine, all rights Reserved.

You might also like