后台代码   
 public string list = string.Empty;
  protected void Page_Load(object sender, EventArgs e)
  {
  if (!IsPostBack)
  {
  if (Request.QueryString["id"] != null)
  {
  string id = Request.QueryString["id"].ToString();
  string sql = "select * from CaseInformation where id=" + id;
  SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["NOKIAConnectionString"].ConnectionString);
  SqlCommand cmd = new SqlCommand(sql, conn);
  SqlDataAdapter sda = new SqlDataAdapter(cmd);
  DataSet ds = new DataSet();
  sda.Fill(ds);
  list += "<div class=\"ta_con left\">";
  foreach (DataRow dr in ds.Tables[0].Rows)
  {
  list += "<div class=\"n_title\">" + dr["title"].ToString() + "</div><!--//n_title-->" +
  "<div class=\"n_time\">新闻来源:学友传媒 发布时间:" + dr["time"].ToString().Substring(0, 9) + "</div><!--//n_time-->" +
  "<span class=\"text_1\">" + dr["Pictures"].ToString() + "</span>";
  }
  list += "</div>";
  }
  }
  }显示页面
<div id=x>
<%=list %>
  </div>
<div class="editor"></div>  
<div class="page"><webdiyer:AspNetPager 
        ID="AspNetPager1" runat="server" FirstPageText="首页" LastPageText="末页" 
        NextPageText="下一页" PrevPageText="上一页">
    </webdiyer:AspNetPager></div></span>  
</div>

解决方案 »

  1.   

    <asp:DataPager runat="server" ID="dpLogPage" PagedControlID="lsvLogBody" PageSize="6">
                    <Fields>
                        <asp:NextPreviousPagerField ShowFirstPageButton="true" ShowPreviousPageButton="true" ShowNextPageButton="false"/>
                        <asp:NumericPagerField ButtonCount="6"/>
                        <asp:NextPreviousPagerField ShowLastPageButton="true" ShowPreviousPageButton="false" ShowNextPageButton="true"/>
                    </Fields>
                </asp:DataPager>
    设置一下参数就好。有现成的的属性。查一下基本的控件属性。绑定一下控件