Hi all,
I'm new to the forum and new to ASP.NET and having lots of problems. All the programming I've ever done has been in C and it's been a LONG time since I've done that. We took on a new project at work that uses ASP.NET 1.1 mixed with Visual Basic, so I'm taking a self study type course to get up to speed, and I can't even get the first example running. It's the good old Investment Calculator program where you enter the starting and ending amount and the rate of growth and tell how many years it takes to grow. I'm pasting my code below...I tried looking at several online tutorials and the Wrox Asp.Net 1.1 with
VB.Net book and I don't see what I'm doing wrong. I don't even know if it's doing the calculations and it's certainly not printing the answer!
Apart from any suggestions on this program, if you have any suggestions of good "remedial" ASP.NET resources that I could look at I would really appreciate it. I'm so lost and I'm not sure where to begin.
-Lessa
--------------
<%@ Page Language="
vb" runat="server" %>
<script runat="server">
Sub Calculations()
Dim dblInvestment As Double = CDbl(txtStartingInvestment.text)
Dim dblFinalInvestment As Double = CDbl(txtEndingInvestment.text)
Dim dblGrowth As Double = CDbl(txtGrowth.text)
dim Years as integer=0
do while dblInvestment < dblFinalInvestment
dblInvestment = (dblInvestment * dblGrowth) + dblInvestment
Years = Years + 1
loop
lblyears_result.text = CStr(Years)
End Sub
</script>
<html>
<head>
</head>
<body>
<h3>Investment Calculator
</h3>
<form runat="server">
Please enter your initial investment: $
<asp:TextBox id="txtStartingInvestment" runat="server" width="80px"></asp:TextBox>
<br />
Please enter your desired ending amount: $
<asp:TextBox id="txtEndingInvestment" runat="server" width="80px"></asp:TextBox>
<br />
Please enter the percentage of growth (i.e. 0.08 for 8 percent)
<asp:TextBox id="txtGrowth" runat="server" width="80px"></asp:TextBox>
<br />
<asp:button id="Button1" runat="server" text="Submit"></asp:button>
<asp:Label id="lblyears_result" runat="server"></asp:Label>
<br />
<br />
</form>
</body>
</html>