Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 1.1
This is the forum to discuss the Wrox book Beginning ASP.NET 1.1 with Visual C#.NET 2003 by Chris Ullman, John Kauffman, Chris Hart, Dave Sussman, Daniel Maharry; ISBN: 9780764557088
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 1.1 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 July 6th, 2004, 01:55 PM
Registered User
 
Join Date: Jul 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Sarah-WCHM
Default Chapter 4 error

I am working my way through the book and doing all of the exercises and Try-It-Outs as I come to them. While the one on p. 122 is not necessary for my intended use of ASP.Net it is still frustrating. I can't get the exercise to work and when I use the code from the download instead of my own code I get the same error -- that the date is not recognized as valid but ONLY when the date is a 2005 date. Nothing happens when I use a 2004 date (as intended, I believe).

Has anybody else experienced this particular bug?

 
Old July 6th, 2004, 03:16 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
Default

The code on page 122 in the c# Book is missing opening CurlyQ on the if (IsPostBack) line. I assume your problem is with TIO #1.

The code below works. Place it inside of the <script> tags.

This should be confirmed and moved to the erata page?

Code:
void Page_Load()
{
    if (IsPostBack)
    {
        DateTime datInput;
        datInput = Convert.ToDateTime(txtIn.Text);
        if (
            datInput >=Convert.ToDateTime("1/1/2005")
            &&
            datInput <=Convert.ToDateTime("12/31/2005")
        )
        lblOut.Text = "Date inside year 2005." + datInput;
     }
}
Is your problem something else?




Hal Levy
Web Developer, PDI Inc.

NOT a Wiley/Wrox Employee
 
Old July 6th, 2004, 04:40 PM
Registered User
 
Join Date: Jul 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Sarah-WCHM
Default

Thanks for the prompt response! The error WAS that particular one, combined with another--the date format on my computer is set to Canada, which reverses the month & day. Fixing both fixed my problem. Again, thanks!

 
Old July 7th, 2004, 08:35 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Sarah,

Good point there- perhaps the eratta should also list that the date must be in the same format as your local settings...


Hal Levy
Web Developer, PDI Inc.

NOT a Wiley/Wrox Employee
 
Old July 25th, 2004, 08:52 AM
Registered User
 
Join Date: Jul 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi There, just came across the same problem. Glad you took the time to solve it. I am only starting out, but this makes me wonder: ASP.NET is meant for web development. As coders cannot expect the rest of the world to conform to US date/time notation, how do we ensure that end users do not get errors like this one?
 
Old July 28th, 2004, 09:57 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
Default

1. Pick a standard and tell your users what that standard is.
2. Create cases based on regional settings and write different code for each region.



Hal Levy
Web Developer, PDI Inc.

NOT a Wiley/Wrox Employee





Similar Threads
Thread Thread Starter Forum Replies Last Post
error with chapter 7 busteronline BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 15 August 21st, 2008 03:22 PM
error with chapter 7 jdz66 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 August 21st, 2006 05:19 PM
Parse error in error handler (Chapter 8) Funky Monk BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 1 August 6th, 2004 08:59 AM





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