gridview分页只需点击两次而不是一次点击 [英] gridview paging takes two clicks instead of one click
本文介绍了gridview分页只需点击两次而不是一次点击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<asp:GridView ID="gridName" runat="server" BackColor="White" OnPageIndexChanging="gridName_PageIndexChanging"
BorderColor="#336666" AllowPaging="True" CssClass="Grid"
HorizontalAlign="Center" EnableViewState="true" Font-Size="Medium" ShowFooter="True" OnRowEditing="gridName_RowEditing" >
<footerstyle forecolor="#333333" />
<HeaderStyle ForeColor="White" Font-Size="Medium" HorizontalAlign="Center" />
<pagerstyle backcolor="#336666" forecolor="White" horizontalalign="Center" />
<rowstyle forecolor="#333333" horizontalalign="Center" verticalalign="Middle" />
<SelectedRowStyle Font-Bold="True" />
protected void gridName_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
gridName.PageIndex = e.NewPageIndex;
if (!IsPostBack && !IsCallback)
{
gridName.DataBind();
}
}
protected void gridName_RowEditing(object sender, GridViewEditEventArgs e)
{
gridName.EditIndex = e.NewEditIndex;
}
-------
这是我的代码。我该怎么办?
-------
this is my code. what should i do?
推荐答案
在web.config中你有一行设置smartNavigation =true。尝试将其设置为false并解决问题。
In web.config you have a line setting smartNavigation="true". Try to set it to false and that fixed the problem.
这篇关于gridview分页只需点击两次而不是一次点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文