Home >
Backend Development >
PHP Tutorial >
AspNetAjaxPager, Asp.Net universal non-refresh Ajax paging control, supports multi-style and multi-data binding_PHP tutorial
AspNetAjaxPager, Asp.Net universal non-refresh Ajax paging control, supports multi-style and multi-data binding_PHP tutorial
WBOY
Release: 2016-07-21 15:47:11
Original
775 people have browsed it
This control can paginate GridView, Repeater, DataGrid, DataList... almost all .net data binding controls, all without refreshing. The data binding part can use stored procedures or directly use sql statements, which has no impact on this control. interference! This control has a good user interface and can change various styles according to needs. The effect is even better when combined with css control! 1. Pagination style rendering:
2. How to use: Add in the bin directory: AspNetAjaxPager.dll references the content of the aspx file:
//============================================ ============================ // Company name: Wildren Network Studio (http://www.wildren.com ) // Machine name: WWW-BBE63F97A80 // Registered organization name: Lenovo (Beijing) Limited // CLR version: 2.0.50727.1433 // File name: Default.aspx.cs // Creator: Shao Long // Creation time: 2009-4-4 16:29:49 // Program version: Version 1.0 // Function description: AspNetAjaxPager uses Demo //Modification record: //======================================== ================================ using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System. Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.OleDb; using AspNetAjaxPager.Delegate; namespace Demo { public partial class _Default : System.Web.UI.Page { private OleDbConnection conn; private OleDbCommand cmd; protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { this.BindData(this.Pager1.CurrentPageIndex, this.Pager1.PageSize); } else { ///Click During paging navigation, the binding event is triggered by the control proxy object to redisplay the data this.Pager1.OnPageIndexChanged = new PageIndexChangedDelegate(BindData); } } /// /// Bind Repeater data /// /// /// public void BindData(int PageIndex, int PageSize) { int intStartIndex = (PageIndex - 1) * PageSize + 1; int intEndIndex = PageIndex * PageSize; conn = new OleDbConnection(); conn.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/app_data/db.mdb" ; select count(*) from students"; int totalCount = (int)cmd.ExecuteScalar(); cmd.CommandText = string.Format("select * from students where id >= {0} and id <= {1}", intStartIndex, intEndIndex); DataSet ds = new DataSet(); OleDbDataAdapter da = new OleDbDataAdapter(cmd.CommandText, conn); da.Fill(ds); this.Pager1.RecordCount = totalCount; this.Repeater1.DataSource = ds; this.Repeater1.DataBind(); } } }
http://www.bkjia.com/PHPjc/320009.html
www.bkjia.com
truehttp: //www.bkjia.com/PHPjc/320009.htmlTechArticleThis control can be used for GridView, Repeater, DataGrid, DataList...almost all .net data binding controls. Paging, all without refreshing, the data binding part can use stored procedures or directly...
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn