Wrox Programmer Forums
|
BOOK: ASP.NET Website Programming Problem-Design-Solution
This is the forum to discuss the Wrox book ASP.NET Website Programming: Problem - Design - Solution, Visual Basic .NET Edition by Marco Bellinaso, Kevin Hoffman; ISBN: 9780764543869
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET Website Programming Problem-Design-Solution 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 20th, 2004, 03:23 AM
Registered User
 
Join Date: Jul 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default News Manager Only shows First 2 Categories



In the News Manager section Show Headlines, only
the First two categories: Books and DVD and their
related entries ever show up. Even though the
database download contains other categories and news items,
they don't appear either. I've added categories and items, but nothing ever appears under the News page.

Has anyone else experienced this? If you know what I'm
over looking please let me know. Thank you!

Shawn Cohan
info@allsquared.com




Shawn Cohan
 
Old July 20th, 2004, 08:55 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This is working as intended. If you look at the page "ShowHeadlines.aspx", you'll see that it only includes controls for the 2 categories (look at the HTML version of this page). You can add another category here easily by copying the entry for books, and using the ID of the new category. For example:

<NewsManager:Headlines ID="DotNet" runat="server" CssClass="Book_News_General"
 HeaderStyle="Book_News_Header" ItemStyle="Book_News_Item"
 AlternatingItemStyle="Book_News_AlternatingItem" Width="500px" CategoryID="3" />

I am using the Books styles here because I don't want to create new styles right now. This shows the 3 categories when you view the news.

The following discussion assumes you are using C#, but this works the same in VB.

You might have wondered why you can't see a list of categories straight from the DB? You have a stored proc "sp_News_GetCategories" that returns all the categories, and that is properly being called by the businesss object in file categories.cs, which is beging called by GetCategories() in category.cs.

So, with all that work to ensure that you can see a list of categories from the DB, why can't you? Because this function is only being called in one place, and that place is NOT an active part of the application! The file ShowCategories.aspx will show the categories straight from the DB. But this page is not on any of the other menus, so it is not being displayed.

Furthermore, if you have the C# version of the code, there's a bug in this page. It's easy to fix: the code (HTML view) needs a "form" tag just inside the body:

<body>
<form id="top" runat="server">

And you have to close this "form" tag at the end of the file:

</form>
</body>

And, if you may have tried viewing this page before making this correction, then the bad version is being cached and you can't see the correction until you clear the cache. This is a 2 step fix: 1) bring up IE, and empty it's cache, and 2) run "iisreset" from a command prompt.

During development you may want to comment out the OutputCache directive at the top of the page - this caching makes debugging difficult.

Eric
 
Old July 22nd, 2004, 04:14 AM
Registered User
 
Join Date: Jul 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Eric,

Thank you so much for your reply and especially
the level of detail provided. I will make the suggested
corrections.

In reference to your post Updating The Phile II, I would
like to suggest that categories which are added to the
database are displayed in the News section without the
need to add a new control to the page. If I understand you
correctly, the design implements a hard coded control for
each News Category, and only 2 are created? The screen shot
in the book shows 4 categories. The first two have book,then
DVD gif, the last two no graphics. Its misleading. I better
read the book a little closer. Please email me directly if you
care to.

Thank you,
Shawn Cohan
info@allsquared.com

Shawn Cohan
info@allsquared.com
 
Old July 22nd, 2004, 09:32 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

There are 2 different pages, as I explained. The ShowCategories.aspx page DOES show them straight from the DB (as shown in the book). But they didn't link this page in to the site - they wanted to use the "hard-coded" page in the final design (which does NOT show a list of categories, and isn't supposed to).

Make the bug fix for ShowCategories.aspx and bring it up in your browser.

Frankly, I don't like either option. I think we need a *REAL* homepage for books, and one for DVDs. These pages should have the news for their own area. You might have some book users who don't want to see the DVD news.

http://ThePhile/Books/Default.aspx
http://ThePhile/DVD/Default.aspx

The DB holds the image link. The categories without an image don't have it set in the DB. Run the stored proc I mentioned to see these image links. You just have to put an image filename in the DB for those entries.

Eric
 
Old July 23rd, 2004, 11:40 PM
Registered User
 
Join Date: Jul 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Eric,

Thank you for pointing this out. As you said,
ShowCategories.aspx does display them. I fixed
the missing form tags and added a third control
to Show Headlines and that also worked.

Thanks,
Shawn


Shawn Cohan
info@allsquared.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Sub Categories for Forum- tectrix BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 9 May 21st, 2008 05:25 PM
Separating news from the articles and add news pic Isaak BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 December 12th, 2006 11:25 AM
Unlimited categories golden_drifter Access 2 August 31st, 2006 07:21 AM
Deleting Categories spardoe BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 4 July 19th, 2006 03:07 AM
news module - adding new categories andieje BOOK: ASP.NET Website Programming Problem-Design-Solution 3 June 30th, 2006 07:55 PM





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