Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-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 May 1st, 2008, 07:30 PM
Lee Dumond's Avatar
Wrox Author
 
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default HEADS-UP: Error in Article class

I don't know if this has ever been pointed out before, but while playing around a bit, I discovered an error in the download code -- specifically, in the GetArticleCount(bool publishedOnly) method in the Article class.

The method in part is:


public static int GetArticleCount(bool publishedOnly)
      {
         if (publishedOnly)
            return GetArticleCount();

...


It actually should be:


public static int GetArticleCount(bool publishedOnly)
      {
         if (!publishedOnly)
            return GetArticleCount();



If publishedOnly is FALSE, you want to use the overload which doesn't check the publishing criteria, which is GetArticleCount().

The way it is written, it will use the GetArticles() overload when publishedOnly is TRUE, and return the count of ALL articles (published or not), which of course is wrong.
Kinda weird I never noticed this before, but better late than never.
__________________
Visit my blog at http://leedumond.com
Follow me on Twitter: http://twitter.com/LeeDumond

Code:
if (this.PostHelpedYou)
{
   ClickThanksButton(); 
}
 
Old May 1st, 2008, 08:19 PM
Authorized User
 
Join Date: Mar 2008
Posts: 62
Thanks: 1
Thanked 3 Times in 3 Posts
Send a message via Yahoo to kalel_4444
Default

You just solved my UI problem..!!!! :)

I came across what obviously is this error working on converting to LINQ, but I was working during the late night with an unclear head I wasn't sure if I was right or not.

I encountered a GetArticleCount() problem not by viewing the code, but by a UI error.

During testing I had 1 article "NOT" listed, and 1 "NOT" approved. I had a total of 12 articles (10 pulishedOnly). In ManageArticles.aspx in the admin area all 12 were viewable, but in BrowseArticles.aspx with "All Categories" selected from the DDL resulted in an error:

     10 Articles Displayed, but with paging enabled to page 2 (page 2 was empty).

I knew there was a count problem, but I haven't gotten around to troubleshooting it yet. Thanks for the heads up on this, you saved me some debugging time.

Thanks Lee,
Ronnie



 
Old May 1st, 2008, 08:26 PM
Lee Dumond's Avatar
Wrox Author
 
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

Quote:
quote:Originally posted by kalel_4444
 You just solved my UI problem..!!!! :)

I came across what obviously is this error working on converting to LINQ,
Hey, I have been working through this too. I see you pointed out a few errors... I found a couple more as well.

I also have a few quibbles with the way the author approached some of the LINQ functionality. I am going to post my thoughts on this soon. I am really looking forward to your opinion on it, as I think you and I are the only ones here who are working on this Blox. :D

 
Old May 1st, 2008, 11:28 PM
Authorized User
 
Join Date: Mar 2008
Posts: 62
Thanks: 1
Thanked 3 Times in 3 Posts
Send a message via Yahoo to kalel_4444
Default

Well.. I got through the first part of the BLOX and successfully converted the Articles.cs to LINQ. I took a break here, I figure the rest is repetitive, and I got a primer/intro to LINQ in this project.

Though minor errors, I found the BLOX quite helpful. But keep me posted, I'm still very interested in the Blox and LINQ, I just picked up a LINQ publication. If you'd like to PM me, you're more then welcome to.

Now it's time to design and build my application based on what I've learned in this book and blox. :D I already have a design question . Keep an eye out for a new post, I could use some help on it.

Thanks,
Ronnie






Similar Threads
Thread Thread Starter Forum Replies Last Post
ThemeSelector class error xrica32 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 4 August 14th, 2007 08:20 PM
Using class reference getting error rojiin ASP.NET 2.0 Basics 2 July 6th, 2007 01:53 PM
Error in BLL.Article.Article.cs drohm BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 August 14th, 2006 09:56 AM
Compilation error when declare class bluebeta Visual C++ 0 April 26th, 2006 03:06 AM
error ... when calling a class HumaMunir Java Espanol 2 May 7th, 2005 01:09 PM





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