I have a Web page with a form(action=sample.asp),frmProduct. The form has some textboxes (one of which is a key field, sav txtKey) and two submit buttons: one for retrieve (btnRetrieve) and one for delete (btnDelete). In sample.asp, how do I find out which button was clicked?
Name all the buttons on your form with the same name “CMD”. They obviously have different VALUEs?the caption on the button. Then, in your sample.asp page, you can find out which button was pressed and accordingly take action:
Select Case Trim(Request("CMD")) Case "Retrieve" ...retrieval code Case "Delete" ...deletion codeEnd Select