Results 1 to 2 of 2

Thread: AddHandler HELP

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2000
    Posts
    32

    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!!!!!!

  2. #2
    Junior Member
    Join Date
    Sep 2002
    Posts
    23
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width