You create a Web Part that contains the following logging code. (Line numbers are included for reference only.)
01 SPWeb web = SPContext.Current.Web;
02 try
03 {
05 }
06 catch (Exception ex)
07 {
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?
A. Run the code segment at line 09 inside a RunWithElevatedPrivileges delegate.You create a custom page layout that contains the following code segment. (Line numbers are included for reference only.)
01Please enter a number:
02
You create an event receiver.
The ItemAdded method for the event receiver contains the following code segment. (Line numbers are included for reference only.)
01 SPWeb recWeb = properties.Web;
02 using (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 {
17 if (iWeb != null)
18 {
19 iWeb.Close();
20 }
21 }
22 }
23 }
24 }
You need to prevent the event receiver from causing memory leaks.
Which object should you dispose of?
A. oWeb at line 06You 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.)
01 FullTextSqlQuery qry = new FullTextSqlQuery(ServerContext.GetContext(SPContext.
Current.Site));
02 qry.ResultTypes = ResultType.RelevantResults; 04 qry.QueryText = strQuery;
05 ResultTableCollection results = qry.Execute();
Which code segment should you add at line 03?
A. string strQuery = "author:" + searchAuthor;You plan to develop a Web Part that displays a SharePoint list. The Web Part will verify the list permissions when users access it 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?
A. RunWithElevatedPrivilegesYou create a Feature receiver.
You need to hide the Quick Launch navigation bar of a SharePoint site.
What should you use?
A. the Hidden property of each listYou add a delegate control to the
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:
Which property should you use?
A. Template_ControlsYou 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?
A. Set the CreateTask.SpecialPermissions property.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.)
01 public override void ItemUpdating ( SPItemEventProperties prop)
02 {
03 base.ItemUpdating (prop);
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?
A. 04 if ( prop.BeforeProperties ["vti_title "] . ToString () .Contains ("IMPORTANT")) 08 prop.AfterProperties ("Priority"] - "URGENT";You need to schedule a timer job to run every two hours. Which schedule should you use?
A. SPDailyScheduleNowadays, the certification exams become more and more important and required by more and more enterprises when applying for a job. But how to prepare for the exam effectively? How to prepare for the exam in a short time with less efforts? How to get a ideal result and how to find the most reliable resources? Here on Vcedump.com, you will find all the answers. Vcedump.com provide not only Microsoft exam questions, answers and explanations but also complete assistance on your exam preparation and certification application. If you are confused on your 70-573 exam preparations and Microsoft certification application, do not hesitate to visit our Vcedump.com to find your solutions here.