Currently when I create add/edit/delete options for
webpages I use the following format:

3 web pages:

add - This is a regular form where you can add records
into a database. It is submitted to the manage page where
it checks for the existence of a variable (varAdd <>0),
then if it goes to that subroutine, it will insert the
record if the data is good.

edit - This is very similar to the add form except it
pulls the record from the db using a request variable
passed from the manage page. On this form is an "UPDATE"
and a "DELETE" button.

-- example of the code ---
<form action="manage.asp" name="managefrm" method="post">
<table>
<tr>
<td>Field1</td>
<td><input type="text" name="frmField1" value="<%=rs
("Field1")%>">
</td>
</tr>
<tr>
<td colspan="2" align="right">
<input name="UpdateStudent" type="hidden" value ="1" />
<input name="StudentID" type="hidden" value ="<%=StudentID%
>" />&nbsp;
<input class="button" type="submit" value="Update Student"
name="butUpdate" />
<input class="button" type="submit" value="Delete Student"
name="butDelete" />
</td>
</tr>
</Table>
</form>
----- Code End ----------
Notice how I have a value in the hidden Update field and
notice the values in the buttons themselves.

manage - This section is the driver. The add and edit
call this page to process it. Now the way I currently
process an update is by checking hte existance of the
UpdateStudent hidden field, if it is <> 0 then it
processes it like an update. Here is where the problem
occurs. Since the update and delete are in the same form,
I can't pass separate variable to indicate whether an
update or a delete so what I do is this (I know its kinda
janky, but it works and that's why I'm writing):

---- Code start -----
buttonValue = request("butDelete") ' Gets the value of the
delete button if pressed

addStudent= Trim(request("addStudent"))
updateStudent= Trim(request("updateStudent"))

if buttonValue = "Delete Student" then
DeleteStudent= 3
updateStudent= ""
end if
----- Code end -------
Basically, it gets the value of the delete button if it is
pressed, because the UpdateStudent value will have a value
if pressed also, so if it has a value then it resets the
updateStudent value and processes it as a delete.

IS there a better way to tell if theuser pressed the
delete button or Update button using ASP? Thanks.