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 December 15th, 2009, 06:13 PM
Authorized User
 
Join Date: Feb 2009
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default Page title reads Article:{0}

After rating an article, the browser page title reads Article:{0} instead of the title of the article as correctly shown prior to rating it. What gives? Has anyone corrected this behavior?

Cheers.
 
Old December 18th, 2009, 03:46 PM
Lee Dumond's Avatar
Wrox Author
 
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

This is because as the code is originally written, the page title is not re-populated on postbacks.

Easily fixable by moving the following two lines in Page_Load to appear BEFORE the if(!this.IsPostBack), instead of inside it.

Code:
// try to load the article with the specified ID, and raise an exception
// if it doesn't exist
Article article = Article.GetArticleByID(_articleID);
if (article == null)
    throw new ApplicationException("No article was found for the specified ID.");
 
this.Title = string.Format(this.Title, article.Title);
 
if (!this.IsPostBack)
{
 
   ... etc ...
__________________
Visit my blog at http://leedumond.com
Follow me on Twitter: http://twitter.com/LeeDumond

Code:
if (this.PostHelpedYou)
{
   ClickThanksButton(); 
}





Similar Threads
Thread Thread Starter Forum Replies Last Post
Updating Page Title when SelectedIndexChanged sully7 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 November 15th, 2009 01:46 PM
How to print a web page without title, URL, page #, date and time Mattt C# 2 July 17th, 2009 03:02 AM
Page links in forum title jimibt BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 October 17th, 2007 04:37 PM
Reads : Hit counter cutesneakers PHP How-To 1 December 28th, 2004 11:44 AM
Animated scrolling page title joshil Flash (all versions) 1 May 14th, 2004 03:45 PM





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