Chinaunix首页 | 论坛 | 博客
  • 博客访问: 131853
  • 博文数量: 98
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 1017
  • 用 户 组: 普通用户
  • 注册时间: 2011-06-11 13:22
文章分类

全部博文(98)

文章存档

2015年(25)

2014年(42)

2013年(31)

我的朋友

分类: C#/.net

2014-01-03 13:21:36

前台页面:

   


        上一篇:
       
   


   


        下一篇:
       
   




后台代码:
protected void GetPreTitle()
        {
            if (!string.IsNullOrEmpty(NewsID))
            {
                int num = Convert.ToInt32(NewsID);
                DataSet ds = bll.GetList("ID=" + (num - 1));
                if (ds.Tables[0].Rows.Count > 0)
                {
                    newsArr["PreTitle"] = ds.Tables[0].Rows[0]["Title"].ToString();
                    newsArr["PreID"] = num - 1;
                    lblPre.Text=" " + newsArr["PreTitle"].ToString() + "";
                }
                else
                {
                    lblPre.Text ="已经是第一篇";
                }
            }
        }
        
        
protected void GetNextTitle()
        {
            if (!string.IsNullOrEmpty(NewsID))
            {
                int num = Convert.ToInt32(NewsID);
                DataSet ds = bll.GetList("ID=" + (num + 1));
                if (ds.Tables[0].Rows.Count > 0)
                {
                    newsArr["NextTitle"] = ds.Tables[0].Rows[0]["Title"].ToString();
                    newsArr["NextID"] = num + 1;
                    lblNext.Text = " " + newsArr["NextTitle"].ToString() + "";
                }
                else
                {
                    lblNext.Text ="已经是最后一篇";
                }
            }
        }

阅读(410) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~