views:

31

answers:

1

Hi, I am completely new to Asp.net.

I am currently working on a asp.net page coded via Visual Basic

On the page I have these image buttons that are dynamically generated based on the SQL Data the page retrieves.

Unfortunately I could not figure out how to bind a click function to each of these buttons.

the [Control Name].onClick = "Function Name()" is for clientSide scripts.

and I need to bind

Protected Sub Button_InsertNewTextBox_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button_InsertNewTextBox.Click

to the dynamically allocated buttons.

I couldn't figure out how.

Can anyone help?

+2  A: 

I believe in Visual Basic the AddHandler statement is what you're after

Matthew Steeples
I tried using AddHandler "AddHandler currentButton.Click, AddressOf Me.Button_InsertNewTextBox_Click" But the function was never called.Is it some unique property of ASP web page that prevents it from working?
James X.
you may need to put it in the page_load method or something like that
Matthew Steeples