1

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?

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

2 Comments

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?
you may need to put it in the page_load method or something like that

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.