//翻页
 protected void gvArticleList_PageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     this.gvArticleList.PageIndex = e.NewPageIndex;
     if (int.Parse(ddlArticleClass.SelectedItem.Value) == 0)
     {
         gvArticleList.DataSource = article.GetArticleList();
         gvArticleList.DataBind();
     }
     else
     {
         gvArticleList.DataSource = article.GetdsArticleListByCID(int.Parse(ddlArticleClass.SelectedItem.Value));
         gvArticleList.DataBind();
     }
 }
Пример #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ddlNewFish.DataSource = article.GetdsArticleListByCID(3);
         ddlNewFish.DataBind();
         for (int i = 0; i < ddlNewFish.Items.Count; i++)
         {
             Label label = (Label)ddlNewFish.Items[i].FindControl("lbContent");
             if (BLL.TextHelper.NoHTML(label.Text).Length > 10)
             {
                 label.Text = BLL.TextHelper.NoHTML(label.Text).Substring(0, 10) + "....";
             }
             else
             {
                 label.Text = BLL.TextHelper.NoHTML(label.Text);
             }
         }
     }
 }