Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Newbie
Message
From
16/09/2005 08:52:45
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Newbie
Environment versions
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01050216
Message ID:
01050216
Views:
49
Hello,
I am trying to learn ASP.NET out of a book, and I am having some problems that I can't figure out.

What the book told me to do is put the following HTML file into my c:\inetpub\wwwroot dir:
<html>
<head>
<title>
ASP.NET Mathematical Sample
</title>
</head>
<body>
<form method="GET" action="math.aspx">
   <input type="text" name="value1">
<select name="operator">
    <option value="add">+
    <option value="subtract">-
    <option value="multiply">x
    <option value="divide">/
   </select>
   <input type="text" name="value2">
   <input type="submit" value="Get Result">
</form>
</body>
</html>
I did this, and then it told me to create a virtual directory, which I did (mapped to Desktop\Test) and called test, and put in the following (math.aspx):
<%@Import Namespace="System.Decimal"   
<script language="VB" runat="server">
Sub Page_Load(Source as Object, E As EventArgs)
Dim decValue1       As Decimal
Dim decValue2       As Decimal
Dim strOperator     As String
Dim decResult       As Decimal
decValue1 = Request.QueryString("value1")
decValue2 = Request.QueryString("value2")
strOperator = Request.QueryString("operator")

Select Case strOperator
Case "multiply"
decResult = MultiplyValues(decValue1, decValue2)
Case "divide"
decResult = DivideValues(decValue1, decValue2)
Case "add"
decResult = AddValues(decValue1, decValue2)
Case "subtract"
decResult = SubtractValues(decValue1, decValue2)
End Select

Response.Write("The result of your calculation is: " & _
decResult)
End Sub

Function MultiplyValues(decValue1 As Decimal, decValue2 As _
Decimal)

Dim decResult As Decimal
decResult = Multiply(decValue1, decValue2)
Return decResult

End Function

Function DivideValues(decValue1 As Decimal, decValue2 As _
Decimal)

Dim decResult As Decimal
decResult = Divide(decValue1, decValue2)
Return decResult

End Function

Function AddValues(decValue1 As Decimal, decValue2 As _
Decimal)

Dim decResult As Decimal
decResult = Add(decValue1, decValue2)
Return decResult

End Function

Function SubtractValues(decValue1 As Decimal, decValue2 As _
Decimal)

Dim decResult As Decimal
decResult = Subtract(decValue1, decValue2)
Return decResult

End Function
</script>
What happens is if I click on the Get Result button on my html page, it says it can't find the file c:\inetpub\wwwroot\math.aspx. So I moved the math.aspx file to that dir, tried again, and it just brought up the source code instead of performing the operation.

I am an absolute newb at ASP.NET, and I don't know how the troubleshoot this problem. I went through the instructions in the book again, and I seemed to have followed them as well as I could, given they were pretty sketchy.

Any advice? Thanks a lot!

MAC
Very fitting: http://xkcd.com/386/
Next
Reply
Map
View

Click here to load this message in the networking platform