Repeater databinding problems - page events, repeaters and buttons
Posted on 2005-02-24
I'm having a huge problem trying to do something that I thought would be simple. I've got a Repeater, which lists a number of items along with a checkbox besides each.
What should happen is:
- User checks the items to be deleted
- Presses the button
- Checked items are removed from the database
- Page reflects the changes in the underlying data and then allows further selection
The problem is that once the button is pressed the Repeater's contents aren't refreshing. I presume this is because:
When the button is pressed:
- The page reloads
- The Page_Init event fires (this is where I'm doing the databinding)
- The button event fires, which updates the database
This means that the Repeater contains old data.
I've tried rebinding during the PreRender event and in the button event code, but it doesn't seem to help.
What am I doing wrong?