Which code segment should you add at line 05?

You have a SharePoint list named Announcements. You have an event receiver that contains the
following code segment. (Line numbers are included for reference only.) 01 public override void
ItemAdding(SPItemEventProperties properties) 02 { 03 if
(properties.ListItem[“Title”].ToString().Contains(“secret”)) 04 { 05 06 } 07 } You need to prevent
users from adding items that contain the word “secret” in the title to the list. Which code segment
should you add at line 05?

You have a SharePoint list named Announcements. You have an event receiver that contains the
following code segment. (Line numbers are included for reference only.) 01 public override void
ItemAdding(SPItemEventProperties properties) 02 { 03 if
(properties.ListItem[“Title”].ToString().Contains(“secret”)) 04 { 05 06 } 07 } You need to prevent
users from adding items that contain the word “secret” in the title to the list. Which code segment
should you add at line 05?

A.
return;

B.
properties.Status = SPEventReceiverStatus.Continue;

C.
properties.Cancel = false;

D.
properties.Cancel = true;



Leave a Reply 0

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