Parameters The following table lists the parameters of the Perform method. TIP: Any exception thrown within the Perform method is caught by the web part. Afterwards, the web part will set the event's Cancel property to true and set its error message with the exception's Message property. Table 1. Perform method parameters Parameter Description CustomActionContext Allows you to: • Access the HTTPContext object using HTTPContext property. The HTTPContext object allows you to access the Request and Response objects to do various things. • Access the collection of items where this action is to be performed. This collection contains Microsoft.SharePoint.PListItem objects (for qListView and qListForm) or System.Data.DataRow objects (for qSIListView, qSIListForm and qSIChartView). The following statements are true for the second parameters: This parameter is never null and it will contain zero or more SPListItem or DataRow objects. When your custom code is called from the qListForm's toolbar button or qListView's context menu item, the collection will contain one SPListItem object, which is the item that is being right-clicked in the listview or displayed in the list form. When your custom code is called from the qListView's toolbar button, it may contain zero or more SPListItem objects, which are the items that are selected in the listview. When your custom code is called from the qSIListForm's toolbar button or qSIListView's context menu item, the collection will contain one DataRow object, which is the row that is being right-clicked in the listview or displayed in the list form. When your custom code is called from the qSIListView's toolbar button, it may contain zero or more DataRow objects, which are the rows that are selected in the listview. When your custom code is called from the qSIChartView's toolbar button, it contains all the rows that are being used in the chart view CustomActionCancelEventArgs Is used to tell the web part about the outcome of the action. The Perform method may return an object of ActionResult class. This ActionResult is stored by the framework and can be accessed by another action that is executed after this action. If your action does not need to return anything, you can return null. It allows you to: • Cancel the operation by setting the Cancel property to true. • Set a custom error message by setting the Message property. • Access the web part that invokes this action by using the Source property. You may analyze the property of the web part to do different things in your code.