Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB 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 April 8th, 2011, 01:07 PM
Registered User
 
Join Date: Mar 2011
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 14 ASP.Net 4.0

I am doing the "Try It Out" on page 505. I have had no problem up to here. When I tried to test out the code, I receive an error once I try to insert the name. The error points to the NewPhotoAblumID.aspx.vb code. This is the code that I have in place:

Imports PlanetWroxModel

Partial Class _NewPhotoAlbum
Inherits BasePage

Protected Sub EntityDataSource1_Inserted(sender As Object, e As System.Web.UI.WebControls.EntityDataSourceChangedE ventArgs) Handles EntityDataSource1.Inserted
Dim myPhotoAlbum As PhotoAlbum = CType(e.Entity, PhotoAlbum)
Response.Redirect(String.Format("ManagePhotoAlbum. aspx?PhotoAlbumId={0}",
myPhotoAlbum.Id.ToString()))
End Sub
End Class

The error is I am getting is this:

NullReferenceException was unhandled by user code

Object reference not set to an instance of an object.

Trouble shooting tips:

Use the "new" keyword to create an object instance
Check to determine if the object is null before calling the method.
Get general help for this exception.

Not sure what to do. I looked at my code and yours to compare and it looks the same. Any ideas.


Fred Fenk





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 14 Linq and ado.net entity framework pandukal21 BOOK: Beginning ASP.NET 4 : in C# and VB 8 January 28th, 2011 05:19 AM
question for ADO.NET chapter 14 stram BOOK: Beginning ASP.NET 4 : in C# and VB 6 September 27th, 2010 06:44 AM
chapter 14 vthunder70 BOOK: Beginning ASP.NET 2.0 and Databases 2 October 3rd, 2007 02:11 PM
Chapter 14--SQLUpdate.asp Try it out JB977 BOOK: Beginning ASP 3.0 5 February 4th, 2004 02:08 PM





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