Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 24th, 2005, 10:32 AM
Registered User
 
Join Date: Jun 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to braheem Send a message via Yahoo to braheem
Default 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>
 
Old June 24th, 2005, 10:57 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I am missing the part where this page becomes a C# page.

AFAICS, this looks like a classic ASP page with only a C# directive. This doesn't even come close to an ASP.NET page.

What are you using (books, on-line resources) to learn this?

Imar
 
Old June 24th, 2005, 11:02 AM
Registered User
 
Join Date: Jun 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to braheem Send a message via Yahoo to braheem
Default

I am using an online resource W3schools. What I would like to do is create a page with First Name, Last Name and below that have various age ranges for a user to select. Once the form is filled out and the user clicks the submit button I would like a second page to come up displaying the First Name and Last Name and the age range that the user selected. Hope that helps.


Thanks,
braheem
 
Old June 24th, 2005, 11:44 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

But do you want to do this in C# or in "classic" ASP??


Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Design-Time Debugging of ASP.NET Custom Controls robzyc ASP.NET 2.0 Basics 0 July 2nd, 2008 06:29 AM
Problems with debugging ASp.net ocabrera70 ASP.NET 2.0 Basics 1 March 1st, 2006 03:49 PM
Debugging with VB.NET nhdw VB.NET 2002/2003 Basics 8 February 1st, 2004 06:26 AM
Debugging ASP alyeng2000 Classic ASP Components 1 October 15th, 2003 10:14 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.