Which code segment should you use?
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?
What should you do?
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.)
01 protected void Page_Load(object sender, EventArgs e)
02 {
03 SPSite site = null;
04 try
05 {
06 SPSite 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?
What should you do?
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?
Which code segment should you add at line 04?
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.)
01 System.Web.UI.WebControls.TextBox txtBoxTermSetToAdd = new System.Web.UI.WebControls.TextBox();
02 TaxonomySession session = new TaxonomySession(SPContext.Current.Site);
03 TermSet addedTerm = session.TermStores[0].Groups[“MyNewTermStore”].CreateTermSet(txtBoxTermSetToAdd.Text);
04
Which code segment should you add at line 04?
Which code segment should you include in the Web Part?
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?
What should you do?
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.)
01 protected void Page_Load(object sender, EventArgs e)
02 {
03 SPSite site = null;
04 try
05 {
06 SPSite 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?
Which property tag should you add at line 07?
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?
What should you do?
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?
What should you do?
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?
Which element should you use in the Feature?
You create a Feature.
You need to 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?