Web

You might also like

You are on page 1of 1

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.

or
g/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Page Language="VB" debug="true" %>
<script runat="server">
Sub submit_click(ByVal source As Object, ByVal e As CommandEventArgs)
Dim intamt As Integer
intamt = e.commandArgument
If e.commandName = "credit" Then
lbloutput.text += intamt
Else
lbloutput.text -= intamt
End If
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>command event of button control</title>
</head>
<body>
<form id="form1" runat="server">
<asp:Button ID="credit" runat="server" Text="credit 100" CommandName="credit
" CommandArgument="100" OnCommand="submit_click" runat="server"/>
<p>
<asp:Button ID="debit" runat="server" Text="debit 100" CommandName="debi
t" CommandArgument="100" OnCommand="submit_click" runat="server"/>
</p>
<asp:Label ID="lbloutput" runat="server" Text="500"></asp:Label>
</form>
</body>
</html>

You might also like