标题:关于asp.net代码小问题
取消只看楼主
ruirui112811
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2013-6-7
 问题点数:0 回复次数:0 
关于asp.net代码小问题
求助一下代码是啥意思:
public void Band()
    {
        string type = ext_string(Request.QueryString["ID"]);

        try
        {
            this.lbClassName.Text = db1.GetModel(type).ClassName;
        }
        catch
        {
            this.lbClassName.Text = "新闻中心";
        }

        DataSet ds = new DataSet();
        string sqlwhere = " 1=1 ";
        sqlwhere += type != "" ? " and  ClassID='" + type + "'" : "";
        ds = db.GetList(sqlwhere);
        AspNetPager1.RecordCount = ds.Tables.Count;
        
        PagedDataSource pdsList = new PagedDataSource();
        pdsList.DataSource = ds.Tables[0].DefaultView;
        pdsList.AllowPaging = true;
        pdsList.PageSize = AspNetPager1.PageSize;
        pdsList.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
        
        this.replist.DataSource = pdsList;
        this.replist.DataBind();
    }
    protected void AspNetPager1_PageChanged(object sender, EventArgs e)
    {
        Band();
    }
    protected void AspNetPager1_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
    {
        AspNetPager1.CurrentPageIndex = e.NewPageIndex;
    }
}
搜索更多相关主题的帖子: 中心 public 
2013-06-07 22:09



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-414775-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.202696 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved