R
Russell Smallwood
Hello all,
Why can't I wire up an event during the "Raise PostBackEvent" stage of a
postback?
Just in case this is the wrong question, the situation:
deep in the bowls of some code-behind loop:
ImageButton A is created (with ID "A"). ImageButton A's click event is
wired to EventHandler E.
When the user clicks the button, page posts back, page_load runs, event
fires all is good with the world.
During Event E,however, I want to run through aforementioned loop again,
re-creating ImageButton A and assigning its click event to Event E
(again) which seems to work just fine. In fact, all my image buttons
re-appear on the page just like I would expect.
The problem happens when the user clicks on the newly created
ImageButton. The page posts back, page_load fires, but Event E is never
raised.
I'm sure this is by design, but I'm not sure I follow. Don't event
assignments make the round trip in the state bag? I would think that,
as long as I wire everything up before SaveViewState/Render, that ALL
object properties would be saved.
Whate have I missed?
Russell
Why can't I wire up an event during the "Raise PostBackEvent" stage of a
postback?
Just in case this is the wrong question, the situation:
deep in the bowls of some code-behind loop:
ImageButton A is created (with ID "A"). ImageButton A's click event is
wired to EventHandler E.
When the user clicks the button, page posts back, page_load runs, event
fires all is good with the world.
During Event E,however, I want to run through aforementioned loop again,
re-creating ImageButton A and assigning its click event to Event E
(again) which seems to work just fine. In fact, all my image buttons
re-appear on the page just like I would expect.
The problem happens when the user clicks on the newly created
ImageButton. The page posts back, page_load fires, but Event E is never
raised.
I'm sure this is by design, but I'm not sure I follow. Don't event
assignments make the round trip in the state bag? I would think that,
as long as I wire everything up before SaveViewState/Render, that ALL
object properties would be saved.
Whate have I missed?
Russell