LinqDataSource.AutoPage Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets a value that indicates whether the LinqDataSource control supports navigation through sections of the data at run time.
public:
property bool AutoPage { bool get(); void set(bool value); };
public bool AutoPage { get; set; }
member this.AutoPage : bool with get, set
Public Property AutoPage As Boolean
true
if the user can page through the data; otherwise, false
. The default value is true
.
The following example shows a LinqDataSource control with the AutoPage property set to true
and a GridView control that is bound to the LinqDataSource control. The AllowPaging property of the GridView control is set to true
to provide the interface that lets users page through the data.
<asp:LinqDataSource
ContextTypeName="ExampleDataContext"
TableName="Products"
AutoPage="true"
AutoSort="true"
ID="LinqDataSource1"
runat="server">
</asp:LinqDataSource>
<asp:GridView
AllowPaging="true"
AllowSorting="true"
DataSourceID="LinqDataSource1"
ID="GridView1"
runat="server">
</asp:GridView>
<asp:LinqDataSource
ContextTypeName="ExampleDataContext"
TableName="Products"
AutoPage="true"
AutoSort="true"
ID="LinqDataSource1"
runat="server">
</asp:LinqDataSource>
<asp:GridView
AllowPaging="true"
AllowSorting="true"
DataSourceID="LinqDataSource1"
ID="GridView1"
runat="server">
</asp:GridView>
Set the AutoPage property to true
to enable paging in the LinqDataSource control. To enable the user to page through the data, connect a data-bound control that provides the interface for paging to the LinqDataSource control. When the AutoPage property is set to true
, the LinqDataSource control retrieves only enough records for one page in the data-bound control. It uses the Skip and Take methods to retrieve the records for the current page.
Applies to
제품 | 버전 |
---|---|
.NET Framework | 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET 피드백
.NET은(는) 오픈 소스 프로젝트입니다. 다음 링크를 선택하여 피드백을 제공해 주세요.