asp.net| Pagination | controls | data
This article will introduce you to the benefits of developing a customized data paging control using ASP.NET 2.0 1, reduce network traffic 2, improve operational efficiency in the large amount of data, data paging is a must face the reality that no customer is willing to spend a few minutes or more time to wait. There are a number of ways to page paging, such as memory paging SQL Server stored procedure paging and so on, here is a description of the SQL Server stored procedure paging, and combined with ASP.net 2.0 to write a common data paging control. The stored procedures used in this article come from http://www.codeproject.com/aspnet/PagingLarge.asp here thanks to the author, who has provided us with a speed comparison of the various stored process paging methods. Now start your Visual Studio 2005 and then create a new class library project named sqlpaging the following figure then add two class files named AssemblyInfo and sqlpaging the following figure Then open the Properties dialog box for this project set the assembly name to sqlpaging set the root namespace to Drmsystem set the application type to Web control Library The following figure Open AssemblyInfo class Enter the following code imports Systemimports system.web.ui<assembly:tagprefix ("Drmsystem.datalayer", "Drmsp") > "defines the tag prefix used to identify a custom control in a Web page. Open the Sqlpaging class to enter the following code (the namespace used by the importer). ) Imports systemimports System.Collections.GenericImports system.componentmodelimports system.textimports System.Data.SqlClientImports system.webimports System.Web.UIImports System.Web.UI.WebControlsImports system.security.permissions ' defines the style of go to the button public Enum stylegoto LinkButton = 1 ImageButton = 2End enum Enter the following code to add a namespace DataLayer add a class named Sqlpaging. We'll just talk about ToolBoxData. It represents the default markup that is generated for a custom control when you drag it from a toolbox in tools such as Microsoft Visual Studio. Namespace datalayer <aspnethostingpermission (SecurityAction.Demand, _ level : =aspnethostingpermissionlevel.minimal), _ aspnethostingpermission ( SecurityAction.InheritanceDemand, _ level:=aspnethostingpermissionlevel.minimal), _ Defaultproperty ("PageInfo"), _ toolboxdata ("<{0}:sqlpaging runat=" "Server" > </{0 }:sqlpaging> ") > _ public Class sqlpaging Inherits compositecontrol End Classend Namespace