本控件可以对GridView,Repeater,DataGrid,DataList...几乎所有的.net数据绑定控件进行分页,全部无刷新,数据绑定部分可以使用存储过程也可以直接使用sql语句,这对本控件没有任何干扰!本控件具有较好的用户界面,能够根据需要变换各种样式,配合css控制效果则更好!
1.分页样式效果图:
2.如何使用:
于bin目录下添加:AspNetAjaxPager.dll引用
aspx文件内容:
复制代码 代码如下:
.cs檔案內容:
複製程式碼 程式碼如下:
//============ ==================================================== ==========
// 公司名稱: 野人網路工作室(http://www.wildren.com)
// 機器名稱: WWW-BBE63F97A80
// 註冊組織名稱: Lenovo (Beijing) Limited
// CLR版本: 2.0.50727.1433
// 檔案名稱: Default.aspx.cs
// 創作者: 邵龍
// 建立時間cs
// 建立者: 邵龍
// 建立時間cs: 2009-4-4 16:29:49
// 程式版本: 1.0版
// 功能描述: AspNetAjaxPager使用Demo
// 修改記錄:
//====== ==================================================== ==============
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.Web.Web. >private OleDbConnection conn;
private OleDbCommand cmd;
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
if (!Page.IsPostBack)
{; this.Pager1.CurrentPageIndex, this.Pager1.PageSize);
}
else
{
///點擊分頁導航時由控制代理物件觸發綁定事件重新顯示資料
this .Pager1.OnPageIndexChanged = new PageIndexChangedDelegate(BindData);
}
}
///
/// 綁定Repeater
資料
/> >///
///
public void BindData(int PageIndex, int PageSize)
{
int intStartIndex = (PageIndex - 1) * PageSize + 1;
int intEndIndex = PageIndex * PageSize;
conn = new OleDbConnection();
conn.ConnectionString = @convidnvider=. Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/app_data/db.mdb");
cmd = conn.CreateCommand();
conn.Open();
/ //此部分可以換成預存程序分頁,對控制項沒有任何影響
cmd.CommandText = "select count(*) from students";
int totalCount = (int)cmd.ExecuteScalar();
cmd.CommandText = string.Format("select * from students where id >= {0} and id DataSet ds = new DataSet();
OleDbDataAdapterDataSet ds = new DataSet();
OleDbDataAdapterDataSet ds = new DataSet();
OleDbDataAdapter da = new OleDbDataAdapter(cmd.CommandText, conn);
da.Fill(ds);
this.Pager1.RecordCount = totalCount;
this.Repeater1.DataSource = ds;
this.Repeater1 .DataBind();
}
}
以上就介紹了www.xiaoxiaoshuo.net AspNetAjaxPager,AspNet通用無刷新Ajax分頁控件,支援多樣式多資料綁定,包括了www.xiaoxiaoshuo.net方面的內容,希望對PHP教程有興趣的朋友有所幫助。

aphpdepentioncontiveContainerIsatoolThatManagesClassDeptions,增強codemodocultion,可驗證性和Maintainability.itactsasaceCentralHubForeatingingIndections,因此reducingTightCightTightCoupOulplingIndeSingantInting。

選擇DependencyInjection(DI)用於大型應用,ServiceLocator適合小型項目或原型。 1)DI通過構造函數注入依賴,提高代碼的測試性和模塊化。 2)ServiceLocator通過中心註冊獲取服務,方便但可能導致代碼耦合度增加。

phpapplicationscanbeoptimizedForsPeedAndeffificeby:1)啟用cacheInphp.ini,2)使用preparedStatatementSwithPdoforDatabasequesies,3)3)替換loopswitharray_filtaray_filteraray_maparray_mapfordataprocrocessing,4)conformentnginxasaseproxy,5)

phpemailvalidation invoLvesthreesteps:1)格式化進行regulareXpressecthemailFormat; 2)dnsvalidationtoshethedomainhasavalidmxrecord; 3)

tomakephpapplicationsfaster,關注台詞:1)useopcodeCachingLikeLikeLikeLikeLikePachetoStorePreciledScompiledScriptbyTecode.2)MinimimiedAtabaseSqueriSegrieSqueriSegeriSybysequeryCachingandeffeftExting.3)Leveragephp7 leveragephp7 leveragephp7 leveragephpphp7功能forbettercodeefficy.4)

到ImprovephPapplicationspeed,關注台詞:1)啟用opcodeCachingwithapCutoredUcescriptexecutiontime.2)實現databasequerycachingingusingpdotominiminimizedatabasehits.3)usehttp/2tomultiplexrequlexrequestsandreduceconnection.4 limitesclection.4.4

依赖注入(DI)通过显式传递依赖关系,显著提升了PHP代码的可测试性。1)DI解耦类与具体实现,使测试和维护更灵活。2)三种类型中,构造函数注入明确表达依赖,保持状态一致。3)使用DI容器管理复杂依赖,提升代码质量和开发效率。

DatabasequeryoptimizationinPHPinvolvesseveralstrategiestoenhanceperformance.1)Selectonlynecessarycolumnstoreducedatatransfer.2)Useindexingtospeedupdataretrieval.3)Implementquerycachingtostoreresultsoffrequentqueries.4)Utilizepreparedstatementsforeffi


熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

VSCode Windows 64位元 下載
微軟推出的免費、功能強大的一款IDE編輯器

WebStorm Mac版
好用的JavaScript開發工具

mPDF
mPDF是一個PHP庫,可以從UTF-8編碼的HTML產生PDF檔案。原作者Ian Back編寫mPDF以從他的網站上「即時」輸出PDF文件,並處理不同的語言。與原始腳本如HTML2FPDF相比,它的速度較慢,並且在使用Unicode字體時產生的檔案較大,但支援CSS樣式等,並進行了大量增強。支援幾乎所有語言,包括RTL(阿拉伯語和希伯來語)和CJK(中日韓)。支援嵌套的區塊級元素(如P、DIV),

SAP NetWeaver Server Adapter for Eclipse
將Eclipse與SAP NetWeaver應用伺服器整合。

記事本++7.3.1
好用且免費的程式碼編輯器