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