Meraj M

Meraj M

  • NA
  • 175
  • 0

Dynamic event Handler of link button when a submit button is clicked

Feb 19 2010 8:12 AM
I have a page in which we have a button called Generate. when I clicked on it desired outcome is coming but on clicking of lnkbutton it is not working. Pls help

 Protected Sub Generate_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnGenerates.Click

     Dim intLoopIndex As Integer
     For intLoopIndex = 1 To 31
lnkButton = New LinkButton()   lnkButton.Text = strMou  lnkButton.CommandName = "test" lnkButton.CommandArgument = "test" lnkButton.EnableViewState = True AddHandler lnkButton.Click, AddressOf LinkButtonTest_Click pnlResult.Controls.Add(lnkButton)
     Next

End Sub


    Sub LinkButtonTest_Click(ByVal s As Object, ByVal e As CommandEventArgs)


        Response.Write("Woohoo!!!")

    End Sub