Gets or sets the name of the business object that the SelectMethod parameter used to specify a sort expression for data source sorting support.
Assembly: System.Web (in System.Web.dll)
The property is used to support data source sorting. When a SortExpression property is set on the DataSourceSelectArguments object and passed to the Select method, the value identifies the parameter name of the SelectMethod business object method according to which the data is sorted.
If the ObjectDataSource is associated with a data-bound control, the values that are passed to this parameter take the form of comma-separated field values followed by "ASC" or "DESC". For example, the value for an ascending sort on Name would be "Name ASC".
This section contains two code examples. The first code example demonstrates how to implement a type that supports sorting. The second code example demonstrates how to implement a sort expression.
The following code example demonstrates how to implement a type that supports sorting. The SelectMethod of the SortingData class takes a parameter, sortExpression. The string that is passed to SelectMethod is used for the Sort property of the DataView object that is returned by SelectMethod.
The following code example demonstrates how to implement a sort expression. The code in the Web page creates an instance of the ObjectDataSource control. The TypeName property is set to SortingData and the property is set to sortExpression. The AllowSorting property of the GridView control is set to true. When the user clicks the Sort button, the field name, Name or Number, is passed to SelectMethod in the sort parameter.