Debugging ASP.NEt with C#
I am new to C# and having some trouble with debugging, I have created a simple form and I want to pass information using QueryStrings. I have written the first page but when I try to view it I get the following error:
Compiler Error Message: CS1003: Syntax error, '(' expected
Source Error:
Line 16:
Line 17: <input type="radio" name="ages"
Line 18: <%if ages="20-26" then Response.Write("checked")%>
Line 19: value="20-26">20-26</input>
Line 20: <br />
Below is the full program, thank you in advance for your help.
<%@ Page Language="C#" %>
<html>
<body bgcolor="#FFFFCC" text="#000000">
<form action="response_page.asp" method="get">
Fisrt Name: <input type="text" name="fname">
<br />
Last Name: <input type="text" name="lname">
<br /><br />
<%
dim ages;
ages=Request.Form("ages");
%>
<p>Please select your age range:</p>
<input type="radio" name="ages"
<%if ages="20-26" then Response.Write("checked")%>
value="20-26">20-26</input>
<br />
<input type="radio" name="ages"
<%if ages="27-33" then Response.Write("checked")%>
value="27-33">27-33</input>
<br />
<input type="radio" name="ages"
<%if ages="34-40" then Response.Write("checked")%>
value="34-40">34-40</input>
<br />
<input type="radio" name="ages"
<%if ages="41-47" then Response.Write("checked")%>
value="41-47">41-47</input>
<br />
<input type="submit" value="Submit" />
</form>
</body>
</html>
|