九色国产,午夜在线视频,新黄色网址,九九色综合,天天做夜夜做久久做狠狠,天天躁夜夜躁狠狠躁2021a,久久不卡一区二区三区

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
Repeater 控件 + 分頁控件的使用

前臺(tái)頁面 A.aspx:

 

 

 

=============================

后臺(tái)代碼 A.aspx.cs:

 

public partial class ConventionList : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BindToDataList();
        }
    }
    protected void AspNetPager1_PageChanged(object sender, EventArgs e)
    {
        BindToDataList();
    }
 
    private void BindToDataList()
    {
        int pageIndex = this.AspNetPager1.CurrentPageIndex - 1;
        int pageSize = 5;
        this.AspNetPager1.PageSize = pageSize;
        int firstPage = pageIndex * pageSize;
 
        SqlConnection conn = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
 
        string sql = "select M.ExhibitionID,M.SystemID,M.TitleValue,M.ContentValue,M.ScopeValue,M.OrganizerValue,Country.CountryName,Area.AreaName,E.ExhibitionID,E.HttpUrl,E.StartDT,E.EndDT,E.ImageUrl from Country left join Area on Country.CountryID=Area.CountryID left join Pavilion on Area.AreaID=Pavilion.AreaID left join Exhibition E on E.PavilionID=Pavilion.PavilionID left join MultiLangExpo M on M.ExhibitionID=E.ExhibitionID where M.SystemID=1 and E.TypeID=1 and E.deleted=0 and StartDT > getDate() order by StartDT Desc";
        SqlDataAdapter da = new SqlDataAdapter(sql,conn);
        DataSet ds = new DataSet();
        da.Fill(ds, firstPage, pageSize, "listall");
        DataTable dt = ds.Tables["listall"];
        AspNetPager1.RecordCount = getCount(); 
        rptList.DataSource = dt;
        rptList.DataBind();
    }
    private int getCount()
    {
        SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
        string sql = "";
        sql = "select Count(E.ExhibitionID) from Country left join Area on Country.CountryID=Area.CountryID left join Pavilion on Area.AreaID=Pavilion.AreaID left join Exhibition E on E.PavilionID=Pavilion.PavilionID left join MultiLangExpo M on M.ExhibitionID=E.ExhibitionID where M.SystemID=1 and E.TypeID=1 and E.deleted=0 and StartDT > getDate()";
        SqlCommand com = new SqlCommand(sql, con);
        con.Open();
        int temp = Convert.ToInt32(com.ExecuteScalar());
        con.Close();
        return temp;
    }
}
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
簡單的ASP.NET無刷新分頁
AspNetPager分頁控件
ASP.NET 2.0 中AspNetPager.dll控件的分頁方法操作方法
ASPNETPAGER分頁控件的使用方法[圖文]
Asp.Net數(shù)據(jù)控件引用AspNetPager.dll分頁實(shí)現(xiàn)代碼
分頁
更多類似文章 >>
生活服務(wù)
熱點(diǎn)新聞
分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服