ASPX Page - Script Error: Expected ';'

I am using the C# Exam Cram for 70-315, and I have the following code:

<!--Example2_1.aspx -->
<%@ Page Language="C#" %>
<html><head>
<script runat="server">
double ToCelsius(double f)
{
return (5.0/9.0)*(f-32.0);
}
</script></head>
<body>
<h2>Fahrenheit to Celsius Conversion Chart</h2>
<table border="2">
<tr>
<th>
&deg; Fahrenheit</th><th>&deg; Celsius</th>
</tr>
<%
for (double f=50.0; f<=100.0; f++)
{
// Sends formatted output to HTTP response
Response.Output.Write(
"<tr><td>{0}</td><td>" +
"{1:f}</td></tr>", f, ToCelsius(f));
}
%>
</table>
</body>
</html>

When I run it from Visual Studio (View in Browser) I get the following error message:

Line: 5
Char: 10
Error: Expected ';'
Code: 0
URL: http://localhost/ExamCram/315C02/Example2_1.aspx

Alejandro
 
Back
Top