Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_beginners thread: Beginning ASP.NET Using C#'s 3rd chapter's code not working


Message #1 by "Nelson Chan" <shortynelson@h...> on Tue, 18 Mar 2003 07:54:00
Hi, I am reading Beginning ASP.NET Using C# by Wrox. But, when I tried the 
2 pieces of codes from the third chapter, it can't be compiled and run.

The code is saved as holidaypage.aspx. When compiling this page, it gives 
the error that the textbox must be placed within a form tag with 
runat=server. But, I am using the code downloaded from Wrox site. Even 
exactly copied from the book again. But, still the problem comes out. 

I was told that, <asp:<component>..../> must be placed in form tag with 
runat=server, but, in the book, it emphasizes that, NOT to put 
runat=server in form tag. 

I can't do anything with it. Anyone who has read this book can help me 
please? 

Thanks!!!
Message #2 by irfan.syed@g... on Tue, 18 Mar 2003 15:48:20 +0800
Then I think book is wrong and should be thrown out of window! Well just
kidding, but all asp components must be placed within a form tag which 
is
set to run at server. Did the book say not to add another form within
existing form etc?

-----Original Message-----
From: Nelson Chan [mailto:shortynelson@h...]
Sent: Tuesday, March 18, 2003 3:54 PM
To: aspx_beginners
Subject: [aspx_beginners] Beginning ASP.NET Using C#'s 3rd chapter's 
code
not working


Hi, I am reading Beginning ASP.NET Using C# by Wrox. But, when I tried 
the

2 pieces of codes from the third chapter, it can't be compiled and run.

The code is saved as holidaypage.aspx. When compiling this page, it 
gives
the error that the textbox must be placed within a form tag with
runat=3Dserver. But, I am using the code downloaded from Wrox site. Even 

exactly copied from the book again. But, still the problem comes out.

I was told that, <asp:<component>..../> must be placed in form tag with
runat=3Dserver, but, in the book, it emphasizes that, NOT to put
runat=3Dserver in form tag.

I can't do anything with it. Anyone who has read this book can help me
please?

Thanks!!!
Message #3 by "Nelson Chan" <shortynelson@h...> on Tue, 18 Mar 2003 08:10:17
Hi, 

No, it didn't say any other thing. But, I guess, since this book is for 
beginner, like me, it shouldn't expect me to correct its wrong code, or, 
try to give me a test on my understanding or alert of the fault they 
purposely give us, right?

I think, there might be some problem, but, what it is? Please help...

> Then I think book is wrong and should be thrown out of window! Well just
kidding, but all asp components must be placed within a form tag which 
is
set to run at server. Did the book say not to add another form within
existing form etc?

-----Original Message-----
From: Nelson Chan [mailto:shortynelson@h...]
Sent: Tuesday, March 18, 2003 3:54 PM
To: aspx_beginners
Subject: [aspx_beginners] Beginning ASP.NET Using C#'s 3rd chapter's 
code
not working


Hi, I am reading Beginning ASP.NET Using C# by Wrox. But, when I tried 
the

2 pieces of codes from the third chapter, it can't be compiled and run.

The code is saved as holidaypage.aspx. When compiling this page, it 
gives
the error that the textbox must be placed within a form tag with
runat=3Dserver. But, I am using the code downloaded from Wrox site. Even 

exactly copied from the book again. But, still the problem comes out.

I was told that, <asp:<component>..../> must be placed in form tag with
runat=3Dserver, but, in the book, it emphasizes that, NOT to put
runat=3Dserver in form tag.

I can't do anything with it. Anyone who has read this book can help me
please?

Thanks!!!
Message #4 by irfan.syed@g... on Tue, 18 Mar 2003 16:00:45 +0800
Would u mind to send the entire code? And the error message you get?

-----Original Message-----
From: Nelson Chan [mailto:shortynelson@h...]
Sent: Tuesday, March 18, 2003 4:10 PM
To: aspx_beginners
Subject: [aspx_beginners] RE: Beginning ASP.NET Using C#'s 3rd chapter's
code not working


Hi,

No, it didn't say any other thing. But, I guess, since this book is for
beginner, like me, it shouldn't expect me to correct its wrong code, or, 

try to give me a test on my understanding or alert of the fault they
purposely give us, right?

I think, there might be some problem, but, what it is? Please help...

> Then I think book is wrong and should be thrown out of window! Well
> just
kidding, but all asp components must be placed within a form tag which 
=3D
is set to run at server. Did the book say not to add another form within
existing form etc?

-----Original Message-----
From: Nelson Chan [mailto:shortynelson@h...]=3D20
Sent: Tuesday, March 18, 2003 3:54 PM
To: aspx_beginners
Subject: [aspx_beginners] Beginning ASP.NET Using C#'s 3rd chapter's =3D
code not working


Hi, I am reading Beginning ASP.NET Using C# by Wrox. But, when I tried 
=3D
the

2 pieces of codes from the third chapter, it can't be compiled and run.

The code is saved as holidaypage.aspx. When compiling this page, it =3D
gives=3D20 the error that the textbox must be placed within a form tag
with=3D20 runat=3D3Dserver. But, I am using the code downloaded from 
Wrox
site. Even =3D

exactly copied from the book again. But, still the problem comes 
out.=3D20

I was told that, <asp:<component>..../> must be placed in form tag 
with=3D20
runat=3D3Dserver, but, in the book, it emphasizes that, NOT to put=3D20
runat=3D3Dserver in form tag.=3D20

I can't do anything with it. Anyone who has read this book can help 
me=3D20
please?=3D20

Thanks!!!
---
Change your mail options at http://p2p.wrox.com/manager.asp or=3D20 to
unsubscribe send a blank email to 
Message #5 by "Nelson Chan" <shortynelson@h...> on Tue, 18 Mar 2003 08:25:51
Hi, OK, but, it will be a long long one, OK? Ready?... GO!

It consists of 2 files, to pass the info from first to second page.

//holidaypage.aspx
<html>
<head><title>Holiday page</title></head>

<body>
	<form action="holidayresponse.aspx" method="post">
	<h1>Feiertag Holiday</h1>
	Please enter your details here.
	<br /><br />
	Name:<asp:textbox id="FullName" runat="server" />
	<br /><br />
	Address:<asp:textbox id="Address" textmode="multiline" rows="5" 
runat="server" />
	<br /><br />
	Sex -
	<asp:radiobuttonlist id="sex" runat="server">
		<asp:listitem value="Male" />
		<asp:listitem value="Female" />
	</asp:radiobuttonlist>
	Please select the destination you would like details on:
	<asp:dropdownlist id="Destination" runat="server">
		<asp:listitem value="Madrid" />
		<asp:listitem value="Barcelona" />
		<asp:listitem value="Lisbon" />
		<asp:listitem value="Oslo" />
		<asp:listitem value="Prague" />
	</asp:dropdownlist>
	<br /><br />
	<input type="Submit">
	<input type="Reset">
	</form>
</body>
</html>

//holidayresponse.aspx
<script language="c#" runat="server">
	void Page_Load(){
		Response.Write("<b>Name:</b> " + Request.Form["FullName"] 
+ "<br />");
		Response.Write("<b>Address:</b> " + Request.Form
["Address"] + "<br />");
		Response.Write("<b>Sex:</b> " + Request.Form["Sex"] 
+ "<br />");
		Response.Write("<b>Destination:</b> " + Request.Form
["Destination"] + "<br />");
	}
</script>

<html>
<head><title>Holiday page</title></head>

<body>
	<br /><br />
	These details have been entered into out database, you should 
receive a confirmation email from us shortly.
	<br /><br />
</body>
</html>

Thanks for helping!!!!!

> Would u mind to send the entire code? And the error message you get?

-----Original Message-----
From: Nelson Chan [mailto:shortynelson@h...]
Sent: Tuesday, March 18, 2003 4:10 PM
To: aspx_beginners
Subject: [aspx_beginners] RE: Beginning ASP.NET Using C#'s 3rd chapter's
code not working


Hi,

No, it didn't say any other thing. But, I guess, since this book is for
beginner, like me, it shouldn't expect me to correct its wrong code, or, 

try to give me a test on my understanding or alert of the fault they
purposely give us, right?

I think, there might be some problem, but, what it is? Please help...

> Then I think book is wrong and should be thrown out of window! Well
> just
kidding, but all asp components must be placed within a form tag which 
=3D
is set to run at server. Did the book say not to add another form within
existing form etc?

-----Original Message-----
From: Nelson Chan [mailto:shortynelson@h...]=3D20
Sent: Tuesday, March 18, 2003 3:54 PM
To: aspx_beginners
Subject: [aspx_beginners] Beginning ASP.NET Using C#'s 3rd chapter's =3D
code not working


Hi, I am reading Beginning ASP.NET Using C# by Wrox. But, when I tried 
=3D
the

2 pieces of codes from the third chapter, it can't be compiled and run.

The code is saved as holidaypage.aspx. When compiling this page, it =3D
gives=3D20 the error that the textbox must be placed within a form tag
with=3D20 runat=3D3Dserver. But, I am using the code downloaded from 
Wrox
site. Even =3D

exactly copied from the book again. But, still the problem comes 
out.=3D20

I was told that, <asp:<component>..../> must be placed in form tag 
with=3D20
runat=3D3Dserver, but, in the book, it emphasizes that, NOT to put=3D20
runat=3D3Dserver in form tag.=3D20

I can't do anything with it. Anyone who has read this book can help 
me=3D20
please?=3D20

Thanks!!!
---
Change your mail options at http://p2p.wrox.com/manager.asp or=3D20 to
unsubscribe send a blank email to 
Message #6 by irfan.syed@g... on Tue, 18 Mar 2003 16:49:15 +0800
Well, I am pretty sure the book is wrong if you are really 
copying/posting
the code or maybe it is based on some early beta of .Net framework. Also
seems like you are using classic ASP method of building pages too as
compared to new method of using code-behind pages.

So now you have two choices. 1. convert your ASP-controls into HTML
controls in holiday.aspx. i.e. convert
<asp:textbox id=3D"Address" textmode=3D"multiline" rows=3D"5" 
runat=3D"server" />
To
<input type=3D"textbox" name=3D"Address" textmode=3D"multiline" 
rows=3D"5"> and
then it will work

Or you can put runat=3Dserver inside form and then use button click even 
to
submit the form. For this you will need VS.Net to compile.


Convert

-----Original Message-----
From: Nelson Chan [mailto:shortynelson@h...]
Sent: Tuesday, March 18, 2003 4:26 PM
To: aspx_beginners
Subject: [aspx_beginners] RE: Beginning ASP.NET Using C#'s 3rd chapter's
code not working


Hi, OK, but, it will be a long long one, OK? Ready?... GO!

It consists of 2 files, to pass the info from first to second page.

//holidaypage.aspx
<html>
<head><title>Holiday page</title></head>

<body>
	<form action=3D"holidayresponse.aspx" method=3D"post">
	<h1>Feiertag Holiday</h1>
	Please enter your details here.
	<br /><br />
	Name:<asp:textbox id=3D"FullName" runat=3D"server" />
	<br /><br />
	Address:<asp:textbox id=3D"Address" textmode=3D"multiline" rows=3D"5"
runat=3D"server" />
	<br /><br />
	Sex -
	<asp:radiobuttonlist id=3D"sex" runat=3D"server">
		<asp:listitem value=3D"Male" />
		<asp:listitem value=3D"Female" />
	</asp:radiobuttonlist>
	Please select the destination you would like details on:
	<asp:dropdownlist id=3D"Destination" runat=3D"server">
		<asp:listitem value=3D"Madrid" />
		<asp:listitem value=3D"Barcelona" />
		<asp:listitem value=3D"Lisbon" />
		<asp:listitem value=3D"Oslo" />
		<asp:listitem value=3D"Prague" />
	</asp:dropdownlist>
	<br /><br />
	<input type=3D"Submit">
	<input type=3D"Reset">
	</form>
</body>
</html>

//holidayresponse.aspx
<script language=3D"c#" runat=3D"server">
	void Page_Load(){
		Response.Write("<b>Name:</b> " + Request.Form["FullName"]
+ "<br />");
		Response.Write("<b>Address:</b> " + Request.Form
["Address"] + "<br />");
		Response.Write("<b>Sex:</b> " + Request.Form["Sex"]
+ "<br />");
		Response.Write("<b>Destination:</b> " + Request.Form
["Destination"] + "<br />");
	}
</script>

<html>
<head><title>Holiday page</title></head>

<body>
	<br /><br />
	These details have been entered into out database, you should
receive a confirmation email from us shortly.
	<br /><br />
</body>
</html>

Thanks for helping!!!!!

> Would u mind to send the entire code? And the error message you get?

-----Original Message-----
From: Nelson Chan [mailto:shortynelson@h...]=3D20
Sent: Tuesday, March 18, 2003 4:10 PM
To: aspx_beginners
Subject: [aspx_beginners] RE: Beginning ASP.NET Using C#'s 3rd chapter's
code not working


Hi,=3D20

No, it didn't say any other thing. But, I guess, since this book is 
for=3D20
beginner, like me, it shouldn't expect me to correct its wrong code, or, 
=3D

try to give me a test on my understanding or alert of the fault 
they=3D20
purposely give us, right?

I think, there might be some problem, but, what it is? Please help...

> Then I think book is wrong and should be thrown out of window! 
Well=3D20
> just
kidding, but all asp components must be placed within a form tag which 
=3D
=3D3D is set to run at server. Did the book say not to add another form
within existing form etc?

-----Original Message-----
From: Nelson Chan [mailto:shortynelson@h...]=3D3D20
Sent: Tuesday, March 18, 2003 3:54 PM
To: aspx_beginners
Subject: [aspx_beginners] Beginning ASP.NET Using C#'s 3rd chapter's 
=3D3D
code not working


Hi, I am reading Beginning ASP.NET Using C# by Wrox. But, when I tried 
=3D
=3D3D the

2 pieces of codes from the third chapter, it can't be compiled and run.

The code is saved as holidaypage.aspx. When compiling this page, it 
=3D3D
gives=3D3D20 the error that the textbox must be placed within a form tag
with=3D3D20 runat=3D3D3Dserver. But, I am using the code downloaded from 
=3D
Wrox site. Even =3D3D

exactly copied from the book again. But, still the problem comes =3D
out.=3D3D20

I was told that, <asp:<component>..../> must be placed in form tag =3D
with=3D3D20 runat=3D3D3Dserver, but, in the book, it emphasizes that, 
NOT to
put=3D3D20 runat=3D3D3Dserver in form tag.=3D3D20

I can't do anything with it. Anyone who has read this book can help =3D
me=3D3D20 please?=3D3D20

Thanks!!!
---
Change your mail options at http://p2p.wrox.com/manager.asp or=3D3D20 to
unsubscribe send a blank email to 
---
Change your mail options at http://p2p.wrox.com/manager.asp or=3D20 to
unsubscribe send a blank email to 

  Return to Index