The Delegates, when you think about it, are not values, but an array of
memory addresses. Therefore you can't save a handler's address for some
unknown amount of time that then use that value again later since the stack
could be moving around.
What this means is that delegates and events are not serializable and
therefore can not be placed inside of a viewstate. You've got the perfect
solution right now.
"Mark Broadbent" <no****@nospam.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
I had a requirement to code dynamic delegates, so they attach detach from
the button as needed ... then after time realised that the button is not
retaining it's click handlers. To circumvent this I am saving a enum value
to viewstate to tell the load event what delegates handlers to attach on
each postback.
As far as I am concerned I shouldn't need to do this. The button should
retain the state of what handlers have been assigned to it.
Anyone else agree?
Br,
Mark.