Results 1 to 2 of 2

Thread: Add serverSide onClick event to dynamically created control

  1. #1

    Thread Starter
    Hyperactive Member greg_quinn's Avatar
    Join Date
    Nov 2002
    Location
    South Africa
    Posts
    366

    Add serverSide onClick event to dynamically created control

    I have created a button dynamically..

    i.e

    Dim submitBut as New Button()

    submitBut.Text = "Submit Poll"
    myForm.Controls.Add(submitBut)

    Now what I am trying to do is add onClick functionality to my button so that when clicked it calls my server-side function...

    i.e

    Sub SubmitPoll(Sender as Object, E as EventArgs)
    End Sub

    How can I do this????

    submitBut.onClick = "SubmitPoll"

    doesn't work

  2. #2

    Thread Starter
    Hyperactive Member greg_quinn's Avatar
    Join Date
    Nov 2002
    Location
    South Africa
    Posts
    366
    Easy, can't believe it took me an hour to find this!

    AddHandler submitBut.Click, AddressOf submitBut_onClick

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