Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
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
  #1 (permalink)  
Old October 11th, 2007, 02:39 PM
Friend of Wrox
 
Join Date: Sep 2003
Location: Copenhagen, , Denmark.
Posts: 143
Thanks: 0
Thanked 1 Time in 1 Post
Default Additional errata

Page 160, the regular expression is different from the one supplied in the downloaded code.

I didn't see it mentioned in the official errata list, so not sure if this is the proper way to report it?

Cheers,

Peter

http://entropia-online.blogspot.com/
__________________
http://entropia-online.blogspot.com/
  #2 (permalink)  
Old October 15th, 2007, 02:28 PM
Friend of Wrox
 
Join Date: Sep 2003
Location: Copenhagen, , Denmark.
Posts: 143
Thanks: 0
Thanked 1 Time in 1 Post
Default

The Showthread.aspx contains a slight bug as well. If you get a thread with more than 1 page worth of posts, the title (Thread: {0}) will *not* be updated, due to the title only being set in case of NOT a postback.

I did a very quick and very dirty solution:

protected void Page_Load(object sender, EventArgs e)
{
    threadPostID = int.Parse(this.Request.QueryString["ID"]);

    if (!this.IsPostBack)
    {
        threadPostID = int.Parse(this.Request.QueryString["ID"]);
        Post post = Post.GetPostByID(threadPostID);
this.Title = string.Format(this.Title, post.Title); post.IncrementViewCount();
        lblPageTitle.Text = string.Format(lblPageTitle.Text, post.ForumID, post.ForumTitle, post.Title);
        ShowCommandButtons(post.Closed, post.ForumID, threadPostID, post.AddedBy);
    }

became

protected void Page_Load(object sender, EventArgs e)
{
    threadPostID = int.Parse(this.Request.QueryString["ID"]);

    if (!this.IsPostBack)
    {
        threadPostID = int.Parse(this.Request.QueryString["ID"]);
        Post post = Post.GetPostByID(threadPostID);
        post.IncrementViewCount();
        lblPageTitle.Text = string.Format(lblPageTitle.Text, post.ForumID, post.ForumTitle, post.Title);
        ShowCommandButtons(post.Closed, post.ForumID, threadPostID, post.AddedBy);
    }

    try
    {
        Post post = Post.GetPostByID(threadPostID);
        this.Title = string.Format(this.Title, post.Title);
    }

    catch { }
}

http://entropia-online.blogspot.com/


Similar Threads
Thread Thread Starter Forum Replies Last Post
Additional page to my store d-print BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 29 November 23rd, 2007 11:32 AM
How a additional prefix in a namespace comes? diang BOOK: ASP.NET Website Programming Problem-Design-Solution 0 July 13th, 2006 10:40 PM
How to generate an additional field fdtoo SQL Server 2000 2 April 12th, 2006 08:44 AM
Additional basic types in C# Kep C# 1 July 1st, 2004 03:42 PM
Additional Wizards huskie Access 5 August 22nd, 2003 06:59 PM





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