Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4.5 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4.5: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-31180-6
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4.5 : 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 March 10th, 2013, 04:53 PM
Friend of Wrox
 
Join Date: May 2011
Posts: 411
Thanks: 13
Thanked 7 Times in 7 Posts
Default

Quote:
Originally Posted by Imar View Post
Ah there we have it. Here's how you're passing the ID (without Id in the name):
Code:
Response.Redirect(string.Format("ManagePhotoAlbum.aspx?PhotoAlbum={0}", 
                     myPhotoAlbum.Id.ToString()));
and here's how you're reading it (with Id):

Code:
int photoAlbumId = Convert.ToInt32(Request.QueryString.Get("PhotoAlbumId"));
Since the two don't match, the code in the second block tries to a insert a Picture for a PhotoAlbum with an Id of zero which doesn't exist.

Cheers,

Imar
I am just a little bit confused here. How is it that the two don't match? Is this as a result of a typing error from the guy training on your book? Also would it not be possible for him to just throw your code that is downloadable from the Wrox Website into the code behind files and for that to fix the problem? If that is the case could you not just look at side by side comparison of your code and the code that he typed to see where the problems are lying?
 
Old March 10th, 2013, 05:15 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
How is it that the two don't match? Is this as a result of a typing error from the guy training on your book?
Indeed.

Quote:
Also would it not be possible for him to just throw your code that is downloadable from the Wrox Website into the code behind files and for that to fix the problem?
Indeed
Quote:
If that is the case could you not just look at side by side comparison of your code and the code that he typed to see where the problems are lying?
Indeed. But that doesn't mean you always spot the error.

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old March 10th, 2013, 11:15 PM
Registered User
 
Join Date: Mar 2013
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Imar View Post
Indeed.


Indeed

Indeed. But that doesn't mean you always spot the error.

Imar
Winmerge is really good for doing side-by-side comparisons as well. I use it all the time at work.

With it, I found that the following was missing from my EntityDataSource:

OnInserting="EntityDataSource1_Inserting"

That was causing some problems. I'm not sure why it wasn't there, but I did add it.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 14 http request open error flashmanTom BOOK: Beginning JavaScript 4th Edition 0 December 6th, 2011 02:55 PM
Parse Error on Chapter 14 pg 523 hozdaman BOOK: Beginning ASP.NET 4 : in C# and VB 3 August 10th, 2011 02:35 PM
Chapter 14 Code Error? pherank BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 July 4th, 2008 09:05 PM
Linker Error when buidling Sketcher - Chapter 14 Spasticus BOOK: Ivor Horton's Beginning Visual C++ 2005 6 January 11th, 2008 03:52 AM





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