addhandler for runtime button - asp.net 2005

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dgk

    #1

    addhandler for runtime button - asp.net 2005

    I'm trying to create a button in a server table cell at runtime and
    wire it up to an event procedure. I tried this:

    Dim x As New Button
    x.Text = "Edit"
    x.CommandArgume nt = parts(1)
    AddHandler x.Click, AddressOf EditHearing

    EditHearing has two arguments, sender and arguments, but if I use
    System.EventArg s, nothing happens, and addhandler won't let me wire it
    up to an event that has CommandEventArg s.

    I guess I can use a linkbutton but I wanted to do some processing
    before moving off to the next page.

    Ideas appreciated.

Working...