【发布时间】:2017-02-17 19:12:53
【问题描述】:
没有使用更新面板,但内容页面中存在网格。当我单击分页总网格中的任何页码时隐藏。未使用更新面板,但内容页面中存在网格。当我单击分页总网格中的任何页码时:
<asp:GridView ID="GrdViewMasterTable" AutoGenerateColumns="false" runat="server"
AutoGenerateEditButton="true" OnRowEditing="GrdViewMasterTable_RowEditing"
OnRowUpdating="GrdViewMasterTable_RowUpdating"
OnRowCancelingEdit="GrdViewMasterTable_RowCancelingEdit"
AllowPaging="true"
PageSize="15"
OnPageIndexChanging="GrdViewMasterTable_PageIndexChanging"
HorizontalAlign="Left"
OnRowDataBound="GrdViewMasterTable_RowDataBound"
OnRowDeleting="GrdViewMasterTable_RowDeleting"
AutoGenerateDeleteButton="True"
SkinID="GridViewList">
<PagerSettings Mode="Numeric"
Position="Bottom"
PageButtonCount="10" />
<PagerStyle CssClass="pager" HorizontalAlign="Center" />
</asp:GridView>
当我点击分页总网格中的任何页面编号时:
protected void GrdViewMasterTable_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
try
{
if (GrdViewMasterTable.EditIndex != -1)
{
string confirmValue = Request.Form["confirm_value"];
if (confirmValue == "Yes")
{
Update();
GrdViewMasterTable.PageIndex = e.NewPageIndex;
GrdViewMasterTable.DataBind();
//FillGridFromViewState();
//FillGridFromDataTable();
}
else
{
e.Cancel = true;
}
}
else
{
// Clear the error message.
errorMessage = string.Empty;
GrdViewMasterTable.PageIndex = e.NewPageIndex;
GrdViewMasterTable.DataBind();
//FillGridFromViewState();
//FillGridFromDataTable();
}
}
catch (Exception ex)
{
AlertMsg(ex.Message);
}
}
【问题讨论】:
标签: c# asp.net .net c#-3.0 c#-2.0