热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

无法让UpdatePanel在GridView分页上刷新-Can'tgetUpdatePaneltorefreshonGridViewpaging

IhaveaGridViewinanUpdatePanel(ASP.Net2.0).我在UpdatePanel(ASP.Net2.0)中有一个GridView。Ihave

I have a GridView in an UpdatePanel (ASP.Net 2.0) .

我在UpdatePanel(ASP.Net 2.0)中有一个GridView。

I have this code for the PageIndexChanging method of the grid view:

我有网格视图的PageIndexChanging方法的代码:

   protected void grdProductSearch_PageIndexChanging(object sender, GridViewPageEventArgs e)
   {
            grdProductSearch.PageIndex = e.NewPageIndex;
            grdProductSearch.DataBind();
   }

For the UpdatePanel, in the Triggers collection I have added the GridView and the PageIndexChanging method for the EventName.

对于UpdatePanel,在Triggers集合中,我为EventName添加了GridView和PageIndexChanging方法。

Yet, the grid displays data correctly but there is no response when I click the page numbers at the bottom. What am I doing wrong?

然而,网格正确显示数据,但当我点击底部的页码时没有响应。我究竟做错了什么?

Thanks.

谢谢。

1 个解决方案

#1


0  

Since your gridview in the updatepanel, No need to add trigger for paging

由于您在updatepanel中的gridview,无需为分页添加触发器

--In PageIndexchanging event, where you bind data to grid, make sure, data is again fetched from the DB

- 在PageIndexchanging事件中,将数据绑定到网格,确保再次从数据库中提取数据

--Make sure gridview paging is enable...

- 确保gridview分页启用...

AllowPaging="True"

推荐阅读
author-avatar
俊铭士弘政翰
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有