Gets or sets a value that specifies which fields are used for ordering the retrieved data.
Assembly: System.Web.Extensions (in System.Web.Extensions.dll)
You use the property to specify which properties from the returned data to use for sorting. The property for sorting the data must exist in the original data source, but it does not have to be included in the Select property. You can add a space and Ascending, ASC, Descending, or DESC to a property in the string in order to specify how the ordered data is returned.
You can provide more than one property in the property by separating each property by using a comma. For example, to order by properties named LastName and FirstName, set the property to "LastName, FirstName".
When you use the LinqDataSource control with SQL Server 2000 or SQL Server Compact 3.5 and the AutoPage property is set to true, you must provide a value in the property. By default, the AutoPage property is true. If you assign a value to the Select property, you must also include all identity columns in the list of properties that is returned in the query.
If the AutoSort property is set to true, a data-bound control can pass a sort expression to the LinqDataSource control at run time. The LinqDataSource control will apply the sort expression from the data-bound control after it applies the property. Therefore, the data is returned according to the sort expression from the data-bound control.
The following example returns data in reverse alphabetical order based on values in the Category property.