LinkButton点击触发不到事件
.net我自定义的Prpeater分页翻页按钮触发不到事件怎么回事?昨天还行的,今天突然不行了,重新写过事件也不行,跳转按钮可以实现的,就翻页按钮不可以。单独把这个分页和Repeater绑定的数据单独复制出来新建页面又可以,纠结!!
aspx分页代码如下:
<asp:Label ID="LblRecordCount" runat="server"></asp:Label>
<asp:LinkButton ID="btnF" CommandArgument="first" OnClick="btn_Click" runat="server" >首 页 </asp:LinkButton>
<asp:LinkButton ID="btnP" CommandArgument="prev" runat="server" OnClick="btnP_Click">上一页 </asp:LinkButton>
<asp:LinkButton ID="btnN" CommandArgument="next" runat="server" OnClick="btnN_Click">下一页 </asp:LinkButton>
<asp:LinkButton ID="btnL" CommandArgument="last" runat="server" OnClick="btnL_Click">尾 页 </asp:LinkButton>
页次<asp:Label ID="LblCurrentIndex" runat="server" Text="1"></asp:Label>/
<asp:Label ID="LblPageCount" runat="server"></asp:Label>
跳转到:<asp:TextBox ID="TextBox1" runat="server" Width="28px"></asp:TextBox>
<asp:Button ID="Button1" runat="server" onclick="Button1_Click"
Text="跳转" />
<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&n