Last post Jul 08, 2017 03:08 PM by sevi
Jul 07, 2017 09:56 PM|sevi|LINK
An aspx page hosts some labels inside an update panel. Button1 click is what the
AsyncPostBackTrigger is tied to. The labels inside the updatepanel are updated as expected by the Button1 click code.
An unintended side effect is that the call to refresh a gridview via databind() which is at the end of the button1 code does not work. The grid is not repopulated. If I rem the
AsyncPostBackTrigger line, of course the labels are not updated, but the gridview.databind() does work.
Why is this? And how can I get the databind() to work on the gridview?
Jul 08, 2017 07:36 AM|kelmen|LINK
if u dont want the button postback to refresh the gridview, then don't invoke anything about gridview
if u intend to refresh the gridview, ensure whatever data it needed are provided
u pass data to the gridview.datasource, generally
so track the code, where this data come from, how it's being fetch/created, and what else are needed for this whole data to be properly manufactured and feed to the gridview
Jul 08, 2017 02:50 PM|sevi|LINK
You didn't understand what I wrote.
I want the gv to be repopulated at the end of the button click event, and have .databind() there to make that happen. However if I have the button click even listed as a AsyncPostBackTrigger so that the informational labels are updated, the .databind() is
not invoked. That is the problem.
Jul 08, 2017 03:01 PM|mgebhard|LINK
The items within the Update Panel control are refreshed.. The controls outside the update panel are not.
Is the GridView within the Update Panel?
Is there any way you can post the code so the community can reproduce the reported error?
Jul 08, 2017 03:08 PM|sevi|LINK
No the grid is outside the updatepanel. What you've written certainly matches what I experience - so it means I have to either move the gv inside the updatepanel or get rid of the update panel. Either of those will work in this case. Thanks for your input.