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:
Private Sub CommandBtn_Click(ByVal sender As Object, ByVal e As CommandEventArgs) Label1.Text = "You Clicked " & e.CommandArgument End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim tRow As New TableRow Dim tCell As New TableCell Dim tLnkBtn As New LinkButton tLnkBtn.Text = "TestLink1" tLnkBtn.CommandArgument = "Link1" AddHandler tLnkBtn.Command, AddressOf CommandBtn_Click tCell.Controls.Add(tLnkBtn) tRow.Cells.Add(tCell) DeptTbl.Rows.Add(tRow) End Sub




Reply With Quote