hmm,how to access click event of dynamic linkbutton??

eramgarden

Contributor
Joined
Mar 8, 2004
Messages
579
I create dynamic linkbuttons..anywhere from 1 to 20.

After they're created dynamically, how can I access the onclick event of a linkbutton??

This is what I did:
Code:
...
Dim lbView As New LinkButton() 
lbView.Text = "View" 
lbView.ID = strPsId 
[b]AddHandler lbView.Click, AddressOf lbLink_Click [/b]
... 
Sub [b]lbLink_Click[/b](ByVal Sender As Object, ByVal e As EventArgs) 
       'get the id of the linkbutton and do stuff. 

    End Sub

The linkbuttons are displayed, I click on one and nothing happens, doesnt go thru that click event!

what am I missing??
 
Back
Top