[thelist] ASP.NET: Passing the value of a link button

Peter Brunone (EasyListBox.com) peter at easylistbox.com
Tue Aug 8 11:18:05 CDT 2006


		I think I already answered that... just use Sender.Property to get whatever properties you need from the sender (control that triggered the event).

So what was the solution for the untouched subroutine?

				From: "Casey Crookston" caseyc at IntelliSoftmn.com

Ok! I solved the darn problem of the subroutine not executing that I
was working on yesterday. Now, here's a much simpler question (I hope).
In the code below, the value of "e" in GetCategoryResults(e) is equal to
"System.EventArgs" but should be equal to "A" or "M" depending on what
letter the user clicks.

How do I modify AlphaCommand(ByVal sender As Object, ByVal e As
System.EventArgs) to capture the value of the link button clicked?

Thanks!!

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

AddHandler lbAlpha.Click, New EventHandler(AddressOf
AlphaCommand)

plhAlpha.Controls.Add(lbAlpha)

Next

End Sub

Public Sub AlphaCommand(ByVal sender As Object, ByVal e As
System.EventArgs)

GetCategoryResults(e)

End Sub



More information about the thelist mailing list