PrepAway - Latest Free Exam Questions & Answers

Author: seenagape

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 two approaches could you recommend?

You are designing an ASP.NET Web application by using Microsoft Visual Studio 2010. The
Web application uses dynamic HTML (DHTML). You need to ensure that the application
functions properly on multiple browser platforms without requiring the installation of a
clientside component. Which two approaches could you recommend? (Each correct answer
presents a complete solution. Choose two.)

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?