M
Mark
Hi...
I inherited an app that has a control for managing a variable list of
objects. On the page the list gets rendered with LinkButtons next to each
saying "Remove". All of the LinkButtons have id="remove_1", id="remove_2"
and so on.
Just noticed an interesting bug today. If you click remove_1, the postback
happens, the LinkButton's Click event fires and the first element gets
deleted.
When the resulting page is rendered what *was* remove_2 is now remove_1
(since the container control re-constructs the remaining list).
If I click the new remove_1 (former remove_2), the postback happens, all the
controls get instantiated but remove_1's Click event *does not fire*. It
just builds and renders the page again. If I click the LinkButton again,
then it does finally delete the entry.
It seems like there's some kind of state confusion stemming from re-using
the id "remove_1" - like it remembers the last one having been clicked and
therefore doesn't need to click again. But looking at the LinkButton class,
I don't see any state member that I could try to reset.
Where would I be able to clear the memory of the deleted member's having
been clicked?
Thanks
Mark
I inherited an app that has a control for managing a variable list of
objects. On the page the list gets rendered with LinkButtons next to each
saying "Remove". All of the LinkButtons have id="remove_1", id="remove_2"
and so on.
Just noticed an interesting bug today. If you click remove_1, the postback
happens, the LinkButton's Click event fires and the first element gets
deleted.
When the resulting page is rendered what *was* remove_2 is now remove_1
(since the container control re-constructs the remaining list).
If I click the new remove_1 (former remove_2), the postback happens, all the
controls get instantiated but remove_1's Click event *does not fire*. It
just builds and renders the page again. If I click the LinkButton again,
then it does finally delete the entry.
It seems like there's some kind of state confusion stemming from re-using
the id "remove_1" - like it remembers the last one having been clicked and
therefore doesn't need to click again. But looking at the LinkButton class,
I don't see any state member that I could try to reset.
Where would I be able to clear the memory of the deleted member's having
been clicked?
Thanks
Mark