views:

2050

answers:

3

hello - i hope someone can help! i have a user control that has a gridview (there is an update panel in the UC)

i'm using this UC on 2 different pages - on both pages, the UC is on a tab (ajax tabpanel) with the tab being inside an update panel.

on 1 page, when i use the .DataBind() (not initial load), it fires the RowDataBound event and the grid is completed correctly.

BUT on the 2nd page (SAME EXACT CODE!!), the .DataBind does NOT fire the RowDataBound event and the datasource is not bound/refreshed. any ideas why this would happen?

A: 

First check if you have caching enabled (on the server). I would also use break points to trace whether the application gets into the Page_Load event at all.

If your caching is enabled, the browser will cache and not use Page_Load, and consequently not use DataBind().

hope this helps

gnomixa
A: 

k thanks - will give it a try...i'm guessing it has to do with the "calling" page as this same UC works on another page...thanks.

A: 

well i found a solution - i'm not exactly sure why this worked on 1 page and not another but i got it working - i was binding the gridview to a dataview - so i changed it to binding to a datatable and then doing what i needed to do against the row. that worked fine. i think somehow i was binding to a viewstate??? or something of that nature but the RowDataBound event never fired - the dataBinding event would fire...so something about my setup of that "2nd page (the one that didn't work)" was the culprit. thanks for your help! to answer your question above, yes it was getting into the page_load event...