Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > BOOK: Beginning ASP.NET 1.0
|
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 July 6th, 2004, 12:46 PM
Registered User
 
Join Date: Jun 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default System.NullReferenceException on pg 202 example

When I run the example on page 202, without selecting a radio button, it produces an error: System.NullReferenceException :(

The page says taht in this case, no message at all is displayed. How can I trap the error, which I'm assuming is from trying to read: Destination.SelectedItem.Value?


 
Old July 6th, 2004, 10:49 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

Well I have no book to know everything, but I guess u r using [u]SelectedValue or SelectedIndex</u> of ur RadioButton. thats why when u havent select any it gives error!
check it & do ur task in a if

HTH.

Always:),
Hovik Melkomian.
 
Old July 7th, 2004, 09:04 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

If you want to catch it, just use a try catch block:

try

catch objNullEx as System.NullReferenceException
..
catch objEx as System.Exception

end try

Brian





Similar Threads
Thread Thread Starter Forum Replies Last Post
System.NullReferenceException JayLou BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 1 April 6th, 2007 12:55 PM
System.NullReferenceException m_rajib74 C# 0 March 5th, 2007 04:50 AM
System.NullReferenceException lwheless BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 September 24th, 2006 05:47 AM
System.NullReferenceException on WebService Objec ag19702004 General .NET 0 December 23rd, 2005 04:16 PM
System.NullReferenceException: Object reference no nidy_online VS.NET 2002/2003 2 June 9th, 2004 09:17 PM





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