|
 |
aspx_beginners thread: Help with Holiday page (sending data to another page but getting runat error)
Message #1 by "Darrel Austin" <darrelaustin@h...> on Fri, 12 Jul 2002 23:46:17
|
|
I'm working through the sample at the end of chapter three in beginning
ASP.NET where you creat a ASP.NET form and pass the data to another page.
The form on the page, and the text in the book clearly states that you do
not want to put a runat="Server" command in the form tag as it will just
post the data back to iteself (which I understand). However, if DON'T put
the runat attribute in the form tag, I get the following unhandled
exception error triggered by the first ASP.NET form element in encouters:
Control 'Address' of type 'TextBox' must be placed inside a form tag with
runat=server.
So it's basically telling me that I have to have the runat in there, even
though that would prohibit me passing it on to the next page.
Why?
Message #2 by "Corey Rastetter" <corey@w...> on Tue, 16 Jul 2002 03:31:30
|
|
I have no idea why, but I'm getting the same thing, and so are my
friends/coworkers running .NET Server, or XP Pro with .NET Framework SDK
installed.
It's really frustrating since these first files are the basis for all
future examples in the book (i.e. Arrays in Chapter 4). If you've found a
workaround or a reason why it doesn't work, post the answer. I will be
hunting for the same. I'm wondering if this book was written off of RC2
and there was a drastic change in .NET since the release of the book.
Good luck! Let's ping Wrox to see what they have to say!
-Corey
Message #3 by "Allan Williams" <allan@a...> on Mon, 15 Jul 2002 22:59:17 -0400
|
|
Hi Darrel,
Use a nested form page like so:
code for the page holidaypage.aspx (note that I shortened it for clarity)
of particular note is the nested forms. the inner one does not use the
action property, not sure that it even needs the method="post", but I did
not try it without it.
<html>
<head>
<title>Holiday page</title>
</head>
<body>
<form action="holidayresponse.aspx" method="post" >
<form method="post" runat="server">
<h1>Feiertag Holidays</h1>
Please enter your details here.
<br /><br />
Name:<asp:textbox id="FullName" runat="server" />
<br /><br />
<input type="Submit">
<input type="Reset">
</form>
</form>
</body>
</html>
Hope this helps,
-->Allan
-----Original Message-----
From: Darrel Austin [mailto:darrelaustin@h...]
Sent: Friday, July 12, 2002 11:46 PM
To: aspx_beginners
Subject: [aspx_beginners] Help with Holiday page (sending data to
another page but getting runat error)
I'm working through the sample at the end of chapter three in beginning
ASP.NET where you creat a ASP.NET form and pass the data to another page.
The form on the page, and the text in the book clearly states that you do
not want to put a runat="Server" command in the form tag as it will just
post the data back to iteself (which I understand). However, if DON'T put
the runat attribute in the form tag, I get the following unhandled
exception error triggered by the first ASP.NET form element in encouters:
Control 'Address' of type 'TextBox' must be placed inside a form tag with
runat=server.
So it's basically telling me that I have to have the runat in there, even
though that would prohibit me passing it on to the next page.
Why?
Message #4 by "Allan Williams" <allan@a...> on Mon, 15 Jul 2002 22:59:17 -0400
|
|
Corey,
Check the response I just sent to Darrel. It has a work around for the
fiertag holiday page.
basically, it is a nested form.
-->Allan
-----Original Message-----
From: Corey Rastetter [mailto:corey@w...]
Sent: Tuesday, July 16, 2002 3:32 AM
To: aspx_beginners
Subject: [aspx_beginners] Re: Help with Holiday page (sending data to
another page but getting runat error)
I have no idea why, but I'm getting the same thing, and so are my
friends/coworkers running .NET Server, or XP Pro with .NET Framework SDK
installed.
It's really frustrating since these first files are the basis for all
future examples in the book (i.e. Arrays in Chapter 4). If you've found a
workaround or a reason why it doesn't work, post the answer. I will be
hunting for the same. I'm wondering if this book was written off of RC2
and there was a drastic change in .NET since the release of the book.
Good luck! Let's ping Wrox to see what they have to say!
-Corey
Message #5 by "Corey Rastetter" <corey@w...> on Tue, 16 Jul 2002 04:35:46
|
|
It had promise! Unfortunately it didn't work for me though. As soon as I
entered my information and hit submit, I was taken to this error page:
Server Error in '/Ch04' Application.
--------------------------------------------------------------------------
------
The View State is invalid for this page and might be corrupted.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Web.HttpException: The View State is invalid
for this page and might be corrupted.
Source Error:
An unhandled exception was generated during the execution of the current
web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.
Stack Trace:
[HttpException (0x80004005): The View State is invalid for this page and
might be corrupted.]
System.Web.UI.Page.LoadPageStateFromPersistenceMedium()
System.Web.UI.Page.LoadPageViewState()
System.Web.UI.Page.ProcessRequestMain()
--------------------------------------------------------------------------
------
Version Information: Microsoft .NET Framework Version:1.0.3705.209;
ASP.NET Version:1.0.3705.0
Wish I knew enough to figure out what the problem is!
Message #6 by "Corey Rastetter" <corey@w...> on Tue, 16 Jul 2002 16:18:03
|
|
Here's the response regarding this issue from Wrox. The files they
attached were of NO help, so I guess we keep chugging along until we can
figure it out for ourselves! Frankly I'm a little disappointed - I'm a
big fan of Wrox, or else I would've gone elsewhere by now...
===========================================================
Thank you for your email and for using one of our books.
This problem was due to changes between the beta version of the software,
used to write the examples in the book, and the final release version. The
code on page 126 worked on the beta release of .net that we used when
writing the book, but since then Microsoft have made changes and the code,
as it is in the book, no longer works on the current release of .net.
We have provided relevant information regarding the changes required for
use
with the Final Release version of the software on the errata pages for
this
book which you can find at. http://www.wrox.com/ACON16h1.asp?BookID=463
For your convenience I have also attached copies of the revised files to
this email for you.
If you have any further problems regarding any of our books please don't
hesitate to contact us again.
Regards
Rowena Perks
Technical Support Analyst
Wrox Press
==================================================================
Good luck!
-Corey
Message #7 by "Darrel Austin" <darrelaustin@h...> on Tue, 16 Jul 2002 16:32:57
|
|
Allan:
Thanks for the tip. Unfortunately, I'm getting the exact same error as
Corey. So I'm still stumped as well.
-Darrel
> It had promise! Unfortunately it didn't work for me though. As soon as I
e> ntered my information and hit submit, I was taken to this error page:
> Server Error in '/Ch04' Application.
-> ------------------------------------------------------------------------
-
-> -----
> The View State is invalid for this page and might be corrupted.
D> escription: An unhandled exception occurred during the execution of the
c> urrent web request. Please review the stack trace for more information
a> bout the error and where it originated in the code.
> Exception Details: System.Web.HttpException: The View State is invalid
f> or this page and might be corrupted.
> Source Error:
> An unhandled exception was generated during the execution of the current
w> eb request. Information regarding the origin and location of the
e> xception can be identified using the exception stack trace below.
> Stack Trace:
>
[> HttpException (0x80004005): The View State is invalid for this page and
m> ight be corrupted.]
> System.Web.UI.Page.LoadPageStateFromPersistenceMedium()
> System.Web.UI.Page.LoadPageViewState()
> System.Web.UI.Page.ProcessRequestMain()
>
>
-> ------------------------------------------------------------------------
-
-> -----
V> ersion Information: Microsoft .NET Framework Version:1.0.3705.209;
A> SP.NET Version:1.0.3705.0
> Wish I knew enough to figure out what the problem is!
Message #8 by "Darrel Austin" <darrelaustin@h...> on Tue, 16 Jul 2002 16:46:22
|
|
There's an errata page for this book? I figured there was one (what with
all of the typos) but I couldn't actually find it on the site. That link
will probably come in handy as I go through the book...
Corey:
It looks like you need to change both holidaypage AND holidayresponse
pages to get it to work. The change is significant, and seems to be
outside of my full understanding only being at Chapter 3.
I guess the lesson learned is NEVER should ANYONE depend on Microsoft beta
software ;o)
-Darrel
|
|
 |