Web/list.aspx.cs

(完整代码) 1KB

using System;
using System.Collections.Generic;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _list : System.Web.UI.Page
{
    UBW.BLL.books bll = new UBW.BLL.books();

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {

            BindData();
        }
    }

    /// <summary>
    /// 绑定
    /// </summary>
    private void BindData()
    {
        //设置查询条件
        string where = "   price>0  and flag=1 ";
        int count = 0;
        if (Request.QueryString["tid"] != null)
        {
            where += " and tid=" + Request.QueryString["tid"];
        }

      

        if (Request.QueryString["k"] != null)
        {
            where += " and bname like '%" + Request.QueryString["k"] + "%' ";
        }

        DataSet ds = bll.GetData("*", where, AspNetPager1.PageSize * (AspNetPager1.CurrentPageIndex - 1), AspNetPager1.PageSize, out count);
        AspNetPager1.RecordCount = count;

        Repeater1.DataSource = ds;
        Repeater1.DataBind();
    }


    /// <summary>
    /// 分页处理
    /// </summary>
    protected void AspNetPager1_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
    {
        AspNetPager1.CurrentPageIndex = e.NewPageIndex;
        BindData();
    }

}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。