Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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:

...
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??

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...