-
AddHandler HELP
I'm creating a .Net table dynamcially.
I have a sub called CreateTable. I call this sub within the pageload. Within this table, there are image buttons created dynamically. So, within the creation of the table, i use AddHandler and link it to the image buttons.
ex: AddHandler objImage.Command, AddressOf MoveUpclick
When i click on one of the image buttons, the page will postback, run through the pageload event.
If i check to see if the page is being posted back, The event will not fire
Example:
If Not IsPostback then
CreateTable
End if
If i have CreateTable run again (which i don't want it to do), the event will fire fine. Can someone help me figure out how to get this event to fire while makeing sure i don't have to run through the CreateTable sub again?
Thanks in advance!!!!!!
-
Your added handler does not persist across executions of the page. As far as I know you will need to add the handler each time you need it. Include some variables in the ViewState whe the Image buttons are created to tell you what handlers are needed on next execution.