Topics: Business Logic Layer
Sep 3, 2009 at 3:13 AM

Is there a reason that in BlogBasePage.cs

 AddJavaScriptInclude(Utils.RelativeWebRoot + "blog.js", true, true);

is inside a !Page.IsCallback && !Page.IsPostBack block?

I was trying to add some functionality to my default.aspx page, but on postback/callback, I kept getting BlogEngine not defined errors until I moved it outside the block.

Also it would complain about invalid characters in firebug - not sure if it was the urlencoding or the the appending of the blogengine version since i killed both with one edit  - will post back with which was causing the problem.


using the latest build of of blogengine posted by rtur (28608 posted Aug 30)

Sep 3, 2009 at 8:49 AM

The code you posted is not in the latest build of BE.  Prior to changeset 27781, the code in BlogBasePage was:

if (!Page.IsCallback && !Page.IsPostBack)

However, in changeset 27781 (May 30th), that was changed to just:

if (!Page.IsCallback)

It was changed to accommodate situations where a postback occurs.  Generally in BE postbacks do not occur, which is why the old code usually never caused a problem.  One of the rare situations it does occur is when a password has been changed.  After changing a password and a postback has occurred, files like blog.js would not be served to the browser.  The last part of the IF statement was removed in 27781 for these cases, or any other time a postback occurs.

Sep 3, 2009 at 10:47 AM

ah you are correct - serves me right for trying change things on no sleep.  Somehow I brought back an older source code.