I thought this might be easy, but I don't seem to be getting it. I'm working in VB. I'm dynamically creating rows within a table but I wish to add an "EDIT" link/button/event-trigger-of-some-kind that fires a sub, but I need to pass a variable to the sub. The code is as follows. Note the variable that I need to pass is an integer.
Dim CellDescriptionEdit As New TableCell()
RowNameDescription.Cells.Add(CellDescriptionEdit)
CellDescriptionEdit.ID = "CellDescriptionEdit" & UserReader("fldClaimPmtID")
Dim LinkButtonEdit As New LinkButton
LinkButtonEdit.CommandArgument = UserReader("fldClaimPmtID")
LinkButtonEdit.OnClientClick = "LinkButtonEdit_OnClick"
LinkButtonEdit.Text = "EDIT"
CellDescriptionEdit.Controls.Add(LinkButtonEdit)
Then the sub looks like this...
Protected Sub LinkButtonEdit_OnClick(sender As Object, e As EventArgs)
'Lots of happy code but for example purposes let's use this...
lblTest.Text = Int32.Parse(btn.CommandArgument)
End Sub
Any idea how I can get this to work?