Sorry I am thinking of an ImageButton not a standard button; What you would actually have to do would be to loop through the datalist control collection, something like this:
Dim objC As Control
Dim intI as integer
For Each objC In dl.Controls
If TypeOf objC Is Button And objC Is sender Then
Dim btn As Button = CType(objC, Button)
intI = btn.CommandArgument
End If
Next
This will set intI to the value of the buttons command argument
"The one language all programmers understand is profanity."
|