日期:2014-05-17  浏览次数:20411 次

高分求救!!!自定义分页,点击“下一页”的时候无法显示数据,代码如下,请高手指导。
这是前台的部分代码:
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="EachCar.aspx.cs" Inherits="Report_EachCar" %>
<%@ MasterType TypeName="SiteMaster" %>
<%@ OutputCache Duration="60" VaryByParam="*" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
  <script language="javascript" type="text/javascript" src="../Scripts/My97DatePicker/WdatePicker.js"></script> 
   
  <p>
  <span class="style23">第</span><asp:Label ID="lblCurrent" runat="server" 
  CssClass="style23"></asp:Label>
  <span class="style23"><span>页 |每页</span><asp:Label ID="lblPageSize" 
  runat="server"></asp:Label>
  <span>条 |共有</span><asp:Label ID="lblPageTotal" runat="server"></asp:Label>
  <span>页 |共有</span></span><asp:Label ID="lblRowsTotal" runat="server" 
  CssClass="style23"></asp:Label>
  <span class="style23">条信息 |</span>
  <asp:HyperLink ID="hlFirst" runat="server" CssClass="style23">首页</asp:HyperLink>
  <span class="style23">| </span>
  <asp:HyperLink ID="hlPrev" runat="server" CssClass="style23">上一页</asp:HyperLink>
  <span class="style23">| </span>
  <asp:HyperLink ID="hlNext" runat="server" CssClass="style23">下一页</asp:HyperLink>
  <span class="style23">| </span>
  <asp:HyperLink ID="hlLast" runat="server" CssClass="style23">尾页</asp:HyperLink>
  </p>
   
</asp:Content>



这是后台的代码:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using DBCONN;
using System.Configuration;

public partial class Report_EachCar : System.Web.UI.Page
{
  public static string BeginDate, EndDate, Team, Shift, Formula,StrCondition=" ";
  public static string RemoteConnStr = "";
   
  protected void Page_Load(object sender, EventArgs e)
  {
   
  }

  protected void Page_LoadComplete(Object sendr, EventArgs e)
  {
  DropDownList MachineID = (DropDownList)Master.FindControl("dropdownlist1");
  RemoteConnStr = MachineID.Text.Trim();

  if (!IsPostBack)
  {
  SqlConnection conn = new SqlConnection(RemoteConnStr);
  string strSQL = "select mater_name,mater_code from pmt_material order by mater_code";
  SqlCommand cmd = new SqlCommand(strSQL, conn);
  cmd.Connection.Open();
  SqlDataReader myReader = cmd.ExecuteReader();
  while (myReader.Read())
&