I have an ASPX web page with VB code behind, there are 2 asp buttons in the page both being handled by the same event handler, which is...
Protected Sub cmdPrint_Click(sender As Object, e As EventArgs) Handles cmdPrint.Click, cmdReprint.Click
How can I get the name of which of the two buttons was clicked? I have tried the following different methods but I always get the same error 'System.InvalidCastExcepti
Dim buttonClicked As Button = sender
Dim buttonClicked As Button = CType(sender, Button)
Dim buttonClicked As Button = DirectCast(sender, Button)
much Googling tells me either of these should work, but none of them do,
what am I missing?