[thelist] ASP.NET Adding a linkbutton programmatically

Casey Crookston caseyc at IntelliSoftmn.com
Mon Aug 7 15:25:45 CDT 2006


Thanks for the help, Peter.  I'm not using any javasscript other then
what is genrated by the LinkButton.  Here's what I've got so far.... the
problem seems to be getting Private Sub lbAlpha_Click to fire, and once
it does, how to glean the letter that was clicked.

Thanks!

    Private Sub lbCategory_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles lbCategory.Click
        trAlpha.Visible = True
        trButton.Visible = False
        populateAlpha()
    End Sub

    Private Sub populateAlpha()
        Dim i As Integer
        For i = 65 To 90
            Dim lbAlpha As LinkButton = New LinkButton
            lbAlpha.Text = "&#" & i & "; "
            lbAlpha.CssClass = "alpha_link"
            lbAlpha.ID = "lbAlpha" & i
            'lbAlpha.Attributes.Add("OnClick", "lbAlpha_Click()")
            AddHandler lbAlpha.Click, AddressOf lbAlpha_Click
            plhAlpha.Controls.Add(lbAlpha)
        Next
    End Sub

    Private Sub lbAlpha_Click(ByVal sender As Object, ByVal e As
EventArgs)
        trAlpha.Visible = True
        trButton.Visible = False
        lblTest.Text = "Hey There!"
    End Sub




More information about the thelist mailing list