Admin/Form/ADList.aspx.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Linq;
using System.Web.UI;
using System.Web.UI.WebControls;
using Models;


    public partial class ADList : AdminBase
    {
        public int classId;

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

                myDatabind();

            }
        }


        private void myDatabind()
        {

       

            //if (classId != 0)
            //{
                using (Entities bll = new Entities())
                {
                    //var myNew = PredicateBuilder.True<L_Newss>();
                  //  var query = QueryBuilder.Create<L_Newss>();
                    // IQueryable<L_Newss> query = bll.L_Newss;

                    var Bpl = bll.L_AD.OrderByDescending(p => p.NID);

 

                    PagedDataSource pds = new PagedDataSource();
                    pds.DataSource = Bpl.ToList();  //这里好像一定要Tolist();不然会有点错误;
                    pds.AllowPaging = true;
                    AspNetPager1.RecordCount = Bpl.Count(); //记录总数;
                    pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
                    pds.PageSize = AspNetPager1.PageSize;

                    this.rptList.DataSource = pds;
                    this.rptList.DataBind();
                }
            //}

        }



        protected void AspNetPager1_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
        {   //当页面页数改变时,执行这个方法;
            AspNetPager1.CurrentPageIndex = e.NewPageIndex;
            myDatabind();
        }
后面还有 66 行代码,解锁后查看完整代码

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

AI 解读

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

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