PrepAway - Latest Free Exam Questions & Answers

Category: 70-573 (v.1)

Exam 70-573: TS: Microsoft SharePoint 2010, Application Development (update October 30th, 2015)

You need to modify the code in WebPart1 to prevent the pages from loading slowly

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 Sub
Page_Load(ByVal sender As Object, ByVal e As EventArgs) 02 Dim site As SPSite = Nothing 03
Try 04Dim site As New SPSite(“http://www.contoso.com/default.aspx”) 05 Dim web As SPWeb =
site.OpenWeb() 06 07 … 08 Catch 09 10 Finally 11 12 End Try 13End Sub 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?

You need to modify the Web Part to prevent the site from loading slowly

You have a Web Part that contains the following code segment. (Line numbers are included for
reference only.) 01Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) 02
Dim site As New SPSite(“http://www.contoso.com/default.aspx”) 03 If True Then 04 Dim web As
SPWeb = site.OpenWeb() 05 06 End If 07End Sub 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?

Which object should you dispose of?

You create an event receiver. The ItemAdded method for the event receiver contains the following
code segment. (Line numbers are included for reference only.) 01Dim recWeb As SPWeb =
properties.Web 02 Using siteCollection As New SPSite(“http://site1/hr”) 03 Using web As SPWeb
= siteCollection.OpenWeb() 04 Dim oWeb As PublishingWeb =
PublishingWeb.GetPublishingWeb(web) 05 Dim pubWebs As PublishingWebCollection =
oWeb.GetPublishingWebs() 06 For Each iWeb As PublishingWeb In pubWebs 07 Try 08 Dim
page As SPFile = web.GetFile(“/Pages/default.aspx”) 09 Dim wpManager As
SPLimitedWebPartManager = page.GetLimitedWebPartManager(PersonalizationScope.[Shared])
10 Finally 11 If iWeb IsNot Nothing Then 12 iWeb.Close() 13 End If 14 End Try 15 Next 16 End

Using 17 End Using You need to prevent the event receiver from causing memory leaks. Which
object should you dispose of?

Which code segment should you add to the Custom Action node of the Elements.xml file?

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 Custom Action node of the Elements.xml file?

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
#0x01010007FF3E057FA8AB4AA42FCB67B453FFC100E214EEE741181F4E9F7ACC43278EE8
11;#”/> 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?


Page 19 of 24« First...10...1718192021...Last »