Author: DriesM | Posted on: 7/21/2009 5:31:11 PM | Views : 267

Hi,
I have a method that dynamically adds some controls (buttons) to a placeholder in the page_init event. This works fine, all controls are added to the page on every postback.
On the same page I load a grid, and when the grid doesn't have any records I want to load a different set of buttons in the page_init.
But when there is just 1 record in the grid, and I delete this record true a postback, the wrong set of buttons are added to my placeholder, because the page_init method is called before my delete method. so when the controls are rendered to the placeholder, it assumes there is still 1 record in the grid, although i clicked the delete method and the record is deleted.

I tried to solve this problem with a custom recordcount method, but this is fine as long as it concerns a simple count(*) query, but with multiple joins it's a lot of overhead.
I also tried to rerender my controls in the delete method, but then ag ...

Go to the complete details ...