70-573 · Question #264
You have the following event receiver. (Line numbers are included for reference only.) 01 public override void FieldDeleting(SPListEventProperties properties) 02 { 03 base.FieldDeleting(properties)…
The correct answer is D. 04 properties.Status = SPEventReceiverStatus.CancelWithRedirectUrl. MNEMONIC RULE: "CancelWithRedirectUrl, RedirectUrl" Redirect to URL in SharePoint Foundation 2010 Event Receiver and Custom Error Page
Question
You have the following event receiver. (Line numbers are included for reference only.) 01 public override void FieldDeleting(SPListEventProperties properties) 02 { 03 base.FieldDeleting(properties); 04 05 if (properties.FieldName == "Status") 06 { 07 08 09 } 10 } You need to cancel the operation and redirect the user to a custom error page if the name of the deleted field is Status. Which code segments should you add at lines 07 and 08?
Options
- A04 properties.ReceiverData = "/_layouts/customErrorPage.aspx";
- B04 properties.RedirectUrl = "/_layouts/customErrorPage.aspx";
- C04 properties.Status = SPEventReceiverStatus.CancelWithRedirectUrl;
- D04 properties.Status = SPEventReceiverStatus.CancelWithRedirectUrl;
How the community answered
(22 responses)- A5% (1)
- B14% (3)
- C9% (2)
- D73% (16)
Explanation
MNEMONIC RULE: "CancelWithRedirectUrl, RedirectUrl" Redirect to URL in SharePoint Foundation 2010 Event Receiver and Custom Error Page
Topics
Community Discussion
No community discussion yet for this question.