Which code segments should you add at lines 04 and 05?

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); 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?

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); 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?

A.
04 if ( prop.Listltem [“Title”] . ToString () -Contains (“IMPORTANT”)) 05 prop.AfterProperties
[“Priority”] – “URGENT”;

B.
04 if ( prop.AfterProperties [“vti_title “] . ToString () .Contains(“IMPORTANT”)) 05
prop.AfterProperties [“Priority”] = “URGENT”;

C.
04 iff prop.AfterProperties [“vti_title “] . ToString () .Contains(“IMPORTANT”)) 05 prop.Listltem
[“Priority”] = “URGENT”;

D.
04 if ( prop.BeforeProperties [“vti_title “] . ToString () .Contains (“IMPORTANT”)) 08
prop.AfterProperties (“Priority”] – “URGENT”;



Leave a Reply 0

Your email address will not be published. Required fields are marked *