.net我自定义的Prpeater分页翻页按钮触发不到事件怎么回事?昨天还行的,今天突然不行了,重新写过事件也不行,跳转按钮可以实现的,就翻页按钮不可以。单独把这个分页和Repeater绑定的数据单独复制出来新建页面又可以,纠结!!
aspx分页代码如下:    
<asp:Label ID="LblRecordCount" runat="server"></asp:Label>         
<asp:LinkButton ID="btnF" CommandArgument="first" OnClick="btn_Click"  runat="server" >首 页&nbsp; </asp:LinkButton>
<asp:LinkButton ID="btnP"  CommandArgument="prev" runat="server" OnClick="btnP_Click">上一页&nbsp; </asp:LinkButton>
<asp:LinkButton ID="btnN"  CommandArgument="next"  runat="server" OnClick="btnN_Click">下一页&nbsp; </asp:LinkButton>
<asp:LinkButton ID="btnL"  CommandArgument="last" runat="server" OnClick="btnL_Click">尾 页&nbsp; </asp:LinkButton>
 页次<asp:Label ID="LblCurrentIndex" runat="server" Text="1"></asp:Label>/
<asp:Label ID="LblPageCount" runat="server"></asp:Label>
 &nbsp;跳转到:<asp:TextBox ID="TextBox1" runat="server" Width="28px"></asp:TextBox>
                            &nbsp;<asp:Button ID="Button1" runat="server" onclick="Button1_Click" 
                                Text="跳转" />
&nbsp;
                            <asp:Label ID="Label1" runat="server" ForeColor="Red" Font-Size="12px"></asp:Label>
                </div>
                    </div> 
                </div>
            </div>cs文件代码:
protected void Page_Load(object sender, EventArgs e)
    {
        if ( !IsPostBack )
        {
            PageNews();
        }
    }
    private void PageNews()
    {
        SqlConnection mystr = new SqlConnection(ConfigurationManager.ConnectionStrings["robotConnectionString"].ConnectionString);
        mystr.Open();
        string all_sql = "select * from tb_News order by news_id desc";
        DataSet ds = new DataSet();
        SqlDataAdapter da = new SqlDataAdapter(all_sql, mystr);
        da.Fill(ds, "news");        PagedDataSource pds = new PagedDataSource();
        pds.DataSource = ds.Tables["news"].DefaultView;
        pds.AllowPaging = true;
        pds.PageSize = 5;
        int curpage = Convert.ToInt32(LblCurrentIndex.Text);//获取当前页
        pds.CurrentPageIndex = curpage - 1;
        btnFirst.Enabled = true;
        btnLast.Enabled = true;
        btnNext.Enabled = true;
        btnPrev.Enabled = true;
        //判断按钮是否可以点击
        if ( pds.IsFirstPage )
        {
            btnFirst.Enabled = false;
            btnPrev.Enabled = false;
        }
        if ( pds.IsLastPage )
        {
            btnLast.Enabled = false;
            btnNext.Enabled = false;
        }
        LblPageCount.Text = Convert.ToString(pds.PageCount);
        string allcount = "select count(*) from tb_News";
        LblRecordCount.Text = "共" + Convert.ToString(SqlHelper.ExecuteScalar(allcount, null)) + "条记录";
        rpt1.DataSource = pds;
        rpt1.DataBind();
    }    protected void btnFirst_Click(object sender, EventArgs e)
    {
        LblCurrentIndex.Text = "1";
        PageNews();
    }
    protected void btnPrev_Click(object sender, EventArgs e)
    {
        LblCurrentIndex.Text = Convert.ToString(Convert.ToInt32(LblCurrentIndex.Text) - 1);
        PageNews();
    }
    protected void btnNext_Click(object sender, EventArgs e)
    {
        LblCurrentIndex.Text = Convert.ToString(Convert.ToInt32(LblCurrentIndex.Text) + 1);
        PageNews();
    }
    protected void btnLast_Click(object sender, EventArgs e)
    {
        LblCurrentIndex.Text = LblPageCount.Text;
        PageNews();
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        int num = Convert.ToInt32(TextBox1.Text);
        int sum = Convert.ToInt32(LblPageCount.Text);
        if ( num < 0 || num > sum )
        {
            Label1.Text = "请输入有效数值";
        }
        else
        {
            LblCurrentIndex.Text = num.ToString();
            PageNews();
        }
    }
.net