I'm trying to create an HyperLink in a Table and give it an argument so when I'll click it, it will call the CommandBtn_Click.
My problem is that it does'nt call the CommandBtn_Click when i click the HyperLink.
What have I done wrong?

This is my code:

VB Code:
  1. Private Sub CommandBtn_Click(ByVal sender As Object, ByVal e As CommandEventArgs)
  2.         Label1.Text = "You Clicked " & e.CommandArgument
  3. End Sub
  4.  
  5. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  6.         Dim tRow As New TableRow
  7.         Dim tCell As New TableCell
  8.         Dim tLnkBtn As New LinkButton
  9.         tLnkBtn.Text = "TestLink1"
  10.         tLnkBtn.CommandArgument = "Link1"
  11.         AddHandler tLnkBtn.Command, AddressOf CommandBtn_Click
  12.         tCell.Controls.Add(tLnkBtn)
  13.         tRow.Cells.Add(tCell)
  14.         DeptTbl.Rows.Add(tRow)
  15. End Sub