Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 1.0
This is the forum to discuss the Wrox book Beginning ASP.NET 1.0 with C# by Chris Goode, John Kauffman, Christopher L. Miller, Neil Raybould, S. Srinivasa Sivakumar, Dave Sussman, Ollie Cornes, Rob Birdwell, Matt Butler, Gary Johnson, Ajoy Krishnamoorthy, Juan T. Llibre, Chris Ullman; ISBN: 9780764543708
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 1.0 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 December 8th, 2004, 07:38 PM
Registered User
 
Join Date: Dec 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default CH06\SwitchCase.aspx

I am reading the book and have come across an example that bombs if you don’t enter a selection. It is CH06\SwitchCase.aspx which (also has a missing ‘}’ ) bombs with the following error message if no selection is initially made from the radio list:
Object reference not set to an instance of an object.
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.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 5: if (Page.IsPostBack)
Line 6: {
Line 7: switch(Destination.SelectedItem.Value)
Line 8: {
Line 9: case "Barcelona":

Source File: D:\ASPCode\Library\Books\BegASPNET\CH06\SwitchCase .aspx Line: 7

I have struggled with it for some time and seem to have figured out that the either the object “Destination” isn’t created or the Destination.SelectedItem.Value is not created in this situation. Is this correct? Is there a workaround for this situation? Can you please explain?

Thanks in advance.

-Malcolm
Malcolm Donald, Pres.
Accelerant, Inc.
508.540.5830







Similar Threads
Thread Thread Starter Forum Replies Last Post
ch06-xmldistilled not open humayunlalzad BOOK: Beginning XML 3rd Edition 3 February 13th, 2007 09:35 AM
New.aspx works but login.aspx fails Validation nigelhamilton BOOK: ASP.NET Website Programming Problem-Design-Solution 8 September 13th, 2004 02:29 AM
New.aspx works but not Login.aspx ? reidcor BOOK: ASP.NET Website Programming Problem-Design-Solution 2 May 24th, 2004 10:32 AM
HowTo Pass Form data from Page1.aspx to Page2.aspx dati ASP.NET 1.0 and 1.1 Basics 6 January 27th, 2004 06:57 AM





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