LoadItemsEventArgs Class
![]() |
---|
The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience. |
Provides event data for ASP.NET mobile controls that support custom pagination. For information about how to develop ASP.NET mobile applications, see the www.asp.net/mobile Web site.
Assembly: System.Web.Mobile (in System.Web.Mobile.dll)
[ObsoleteAttribute("The System.Web.Mobile.dll assembly has been deprecated and should no longer be used. For information about how to develop ASP.NET mobile applications, see http://go.microsoft.com/fwlink/?LinkId=157231.")] [AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] [AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)] public class LoadItemsEventArgs : EventArgs
Name | Description | |
---|---|---|
![]() | LoadItemsEventArgs(Int32, Int32) | Initializes a new instance of the LoadItemsEventArgs class. This API is obsolete. For information about how to develop ASP.NET mobile applications, see the www.asp.net/mobile Web site. |
Name | Description | |
---|---|---|
![]() | ItemCount | Gets or sets the count of items in the control. This API is obsolete. For information about how to develop ASP.NET mobile applications, see the www.asp.net/mobile Web site. |
![]() | ItemIndex | Gets the index of the first item to be loaded by the invoked event. This API is obsolete. For information about how to develop ASP.NET mobile applications, see the www.asp.net/mobile Web site. |
Name | Description | |
---|---|---|
![]() | Equals(Object) | Determines whether the specified object is equal to the current object.(Inherited from Object.) |
![]() | Finalize() | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.) |
![]() | GetHashCode() | Serves as the default hash function. (Inherited from Object.) |
![]() | GetType() | |
![]() | MemberwiseClone() | |
![]() | ToString() | Returns a string that represents the current object.(Inherited from Object.) |
The class LoadItemsEventArgs object provides event data with information about how many items to load into the control on demand.
The following code example demonstrates how the OnLoadItems event calls the function LoadNow. The ItemIndex property determines the number of items to be added to an array that is bound to a list. In order to see the effects of this example, you must view the page on a device that can paginate the list.
![]() |
---|
The following code sample uses the single-file code model and may not work correctly if copied directly into a code-behind file. This code sample must be copied into an empty text file that has an .aspx extension. For more information, see ASP.NET Web Forms Page Code Model. |
<%@ Page Language="C#" Inherits="System.Web.UI.MobileControls.MobilePage" %> <%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile" %> <script runat="server"> // Called by the List whenever it needs new items private void LoadNow(object sender, LoadItemsEventArgs e) { int j = e.ItemIndex; int estItemSize = 110; // Get the optimum page weight for the device int wt = Form1.Adapter.Page.Adapter.OptimumPageWeight; // Get the number of items per page List1.ItemsPerPage = wt / estItemSize; // Clear the current items List1.Items.Clear(); // Build a section of the array ArrayList arr= new ArrayList(); for (int i = 1; i <= e.ItemCount; i++) { int v = i + j; arr.Add((v.ToString() + " List Item")); } // Assign the array to the list List1.DataSource = arr; List1.DataBind(); } </script> <html xmlns="http://www.w3.org/1999/xhtml" > <body> <mobile:Form id="Form1" runat="server" Paginate="true"> <mobile:List id="List1" runat="server" ItemCount="200" onLoadItems="LoadNow" /> </mobile:Form> </body> </html>
for operating in a hosted environment. Demand value: LinkDemand; Permission value: Minimal.
for operating in a hosted environment. Demand value: InheritanceDemand; Permission value: Minimal.
Available since 1.1
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
System.Web.UI.MobileControls Namespace
Pagination Support
Pagination