|
-
Feb 24th, 2004, 02:18 PM
#1
Thread Starter
Frenzied Member
Last button clicked?
I do remember, that I've seen a post regarding this subject, but I can't find the post when I search.
I need the id of the last button that was clicked on the web form, how do I do that in a nice way ;-) ?
-
Feb 24th, 2004, 07:41 PM
#2
Hyperactive Member
Are you using eventhandlers for your buttons? If you have one event handler per button, then the id should be part of the name of the eventhandler name, if not, or if you have a global event handler to handle any button clicks, cast the sender as a button and grab the id from there.
VB Code:
Protected Sub btnSubmit_Click(ByVal sender as object, ByVal e As System.EventArgs)
Dim btnSubmit As Button = CType(sender, Button)
If Not btnSubmit Is Nothing Then
Response.Write(btnSubmit.ID)
End If
End Sub
something like that, i didn't use a code editor so there may be a typo but you get the idea.
-
Feb 25th, 2004, 02:02 AM
#3
Thread Starter
Frenzied Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|