I am trying to make an ATM-like program. I have 2 buttons, one to deposit $ and one to withdraw $. I also have a text box to enter the amount you want to deposit or withrdraw, as well as a current balance and new balance. My text box isn't working and a few other things seem out of place. I've been working on it and I'm close to finished I just need help finishing it off. Your help would be appreciated...if someone could correct my code.
<script runat="Server" language="
VB">
Sub page_Load()
if Page.IsPostBack then
Dim intnewbal As Double
Sub Add(sender as object, e As EventArgs)
newbal = newbal + CDbl(tbxInput1.text)
lblAnswer.Text = newbal
Session ("newbal") = 0
End Sub
Sub Subtract(sender as object, e As EventArgs)
newbal = newbal - CDbl(tbxInput1.text)
lblAnswer.Text = newbal
Session ("newbal") = 0
End if
End Sub
End Sub
</script>
<html>
<head>
<title>Your ATM Machine</title>
</head>
<body>
<h1>Welcome to the ATM</h1><br/><br/>
<form id="BalanceForm" method ="post" action="bank.aspx runat="server">
Current Balance: $
<span id="bal">0</span>
<asp:textbox id="tbxInput1" runat="server" /><br/>
<asp:Button id="Add" OnClick="Add" runat="server" Text="Deposit Money"/><br>
<asp:Button id="Subtract" OnClick="Subtract" runat="server" Text="Withdraw Money"/><br>
New Balance : <%Session ("BalanceCount") %>
<input type="Submit">
</form>
</body>
</html>