开发者

ASP.net: Paging one Gridview caused other gridviews to reload

开发者 https://www.devze.com 2023-01-18 15:41 出处:网络
I haven\'t actually dealt with multiple grids on one page in a very long time, so perhaps someone can jog my memory. I have two grids and a treeview in开发者_如何学运维 three separate jQuery UI tabs.

I haven't actually dealt with multiple grids on one page in a very long time, so perhaps someone can jog my memory. I have two grids and a treeview in开发者_如何学运维 three separate jQuery UI tabs. Every time I page my gridview, which is a custom control inheriting from Gridview, the other tabs refresh.

How can I stop this?


Are you refreshing the grids in the postback? When you click paging buttons, page_load will fire. Make sure you're testing for !IsPostBack in this event


You will need to do some sort of AJAX postback when you click on the next page link (or button) and refresh/replace your grid rows.

I would steer clear of wrapping everything in an UpdatePanel (if you choose to take this route) as the ViewState will keep growing and growing... and being passed back and forth.

http://msdn.microsoft.com/en-us/library/system.web.ui.updatepanel.aspx

You want to avoid this (view source -> ViewState) -

ASP.net: Paging one Gridview caused other gridviews to reload

0

精彩评论

暂无评论...
验证码 换一张
取 消