Wrox Programmer Forums
BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6
This is the forum to discuss the Wrox book ASP.NET 2.0 Instant Results by Imar Spaanjaars, Paul Wilton, Shawn Livermore; ISBN: 9780471749516
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 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 23rd, 2006, 02:08 AM
Registered User
Join Date: Jul 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Blog Admin wierdness and other rants.

Hi. If I missed a post with this exact problem, my apologies. I am very inebriated right now. ;)

While logged in as admin, and after creating an entry I don't see my "newest" post immediately. It also doesn't show up as an added entry on the links to the left (e.g., "News (0)". It just says 0. If I log out, it acts as intended, I see the latest post and the increased number on the category.

While in Admin, if I click the "News (0)" link, I will see my new posts.

Also, don't know if this is design behavior, but if I log out of admin, then click "Back" on browser, I see the "Create New Entry" button, can click it to navigate to add entry and then can see the text editor. It does, however, give me an error if I try to save it, so that works.

Any advice on the first thing?

On a personal note: Great book because it makes reading fun. :) Easier to read if you get a nice product at the end as a result, even though I use C# (which, for me, coding not being my first line of work, means I don't have time to convert it from VB.net). I'd buy a C# version, too. Anyone been able to port this into C# yet? ;D
Old July 23rd, 2006, 05:11 AM
Imar's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts

Hi bjavierto,

The first issue is more or less by design. Since you're only working with a single page that uses User Controls, not the entire page is refreshed when you add a new Entry. If you look at the EndEditing method in the BlogEntries.ascx control, you see that only the BlogEntries list is reloaded, not the BlogEntriesFilter (as that one is not accessible from the BlogEntries.ascx control).

If you don't like this behavior, there are a few ways to fix it:

1. Change the code for EndEditing to something like this:

Response.Redirect(Request.CurrentExecutionFilePath )

This redirects the parent page to its current location again, effectively reloading the page. You could add some additional code to maintain querystring variables, so you stay in the same calender period or category.

2. You could add an Event on the BlogEntries.ascx controls that fires when you add a new item. The Default.aspx page could listen to that event, and reload the BlogEntriesFilter.ascx control correctly when a new item is added.

Re your second remark: this is a caching issue. You'll find that when you refresh the page using Ctrl+F5 (in IE) that the button disappears. This is because you now have a clean, fresh copy from the server that doesn't include the button.

One solution is to control the caching of pages through your web server (IIS). Alternatively, you can instruct the Cache object on the Response to not cache the page. To do this, add the following code to the Page_Load of Default.aspx"
Protected Sub Page_Load(ByVal sender As Object, _
            ByVal e As System.EventArgs) Handles Me.Load
End Sub
or in your case in C#:
protected void Page_Load(object sender, EventArgs e)
Now the page won't be cached. So, when you click the Back button you should get a fresh copy from the server without the Create New Entry button....

Glad you like the book and find it fun to read.....


Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004

Similar Threads
Thread Thread Starter Forum Replies Last Post
Wrox Blog in C# madAlan BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 22 June 12th, 2011 04:09 AM
Wrox Blog tblessed23 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 16 May 14th, 2007 04:08 PM
Wrox Blog: Viewing individual blog entries Tawanda BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 7 May 7th, 2007 12:06 PM
Wrox Blog Admin addstravel BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 1 April 23rd, 2006 05:41 AM

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