nerdexam
Microsoft

70-573 · Question #265

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…

The correct answer is A. 03 if (prop.AfterProperties["vti_title"].ToString(). MNEMONIC RULE: "AfterProperties on lines 03 and 05" SPItemEventProperties.AfterProperties Property us/library/microsoft.sharepoint.spitemeventproperties.afterproperties.aspx

Developing Business Logic

Question

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 { 02 base.ItemUpdating(prop); 03 04 05 06 07 } 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 03, 04, 05, and 06?

Options

  • A03 if (prop.AfterProperties["vti_title"].ToString().
  • B03 if (prop.AfterProperties["vti_title"].ToString().
  • C03 if
  • D03 if (prop.ListItem["Title"].ToString().Contains("IMPORTANT"))

How the community answered

(34 responses)
  • A
    76% (26)
  • B
    6% (2)
  • C
    15% (5)
  • D
    3% (1)

Explanation

MNEMONIC RULE: "AfterProperties on lines 03 and 05" SPItemEventProperties.AfterProperties Property us/library/microsoft.sharepoint.spitemeventproperties.afterproperties.aspx

Topics

#event receiver#AfterProperties#ItemUpdating#field update

Community Discussion

No community discussion yet for this question.

Full 70-573 Practice