Blanks showing up on default page instead of posts

Topics: ASP.NET 2.0, Business Logic Layer
Mar 17, 2009 at 5:10 PM
Hi all...tried to see if anyone had a similar problem before posting this, but couldn't find anything. I'm running the latest version of Blog Engine on a Windows 2000 server, and I'm using the SQL 2000 database back-end instead of XML. I'm getting sporadic occurrences of the default/homepage not showing the posts on the left hand side (they show up on the bottom right in the recent posts widget). All I see is a blank page. If I click on one of the recent posts in the widget, then go back to the homepage, I can see the posts again.

I've tried debugging this step by step but haven't been able to reproduce it (in my local environment I see the posts, on a development server I don't). The only difference is, that on the development server, I'm going to a main page first, that passes through a querystring with the user's full name. I cannot see how this code would affect the main page of posting, all it does is set a Session variable called "Fullname". Even if I remove this code, I still have the problem.

Any help would be greatly appreciated!!
Mar 17, 2009 at 6:33 PM
If you include an "unknown" querystring parameter for the front page of your blog, then it won't show any posts -- like you're experiencing.  So if you're blog's URL is:

and you add a 'fullname' querystring parameter

Then no posts show up.  If this is the situation you're describing, you can make a small tweak to the code to get the posts so they show up.  In default.aspx.cs, in the Page_Load event, there's this line of code below:

else if (Request.QueryString.Count == 0 || !string.IsNullOrEmpty(Request.QueryString["page"]) || !string.IsNullOrEmpty(Request.QueryString["theme"]) || !string.IsNullOrEmpty(Request.QueryString["blog"]))

You can add the part in bold shown below which would basically ignore the "fullname" querystring parameter.

else if (Request.QueryString.Count == 0 || !string.IsNullOrEmpty(Request.QueryString["page"]) || !string.IsNullOrEmpty(Request.QueryString["theme"]) || !string.IsNullOrEmpty(Request.QueryString["blog"]) || !string.IsNullOrEmpty(Request.QueryString["fullname"]))
Mar 18, 2009 at 8:52 PM
Ben!! You're an absolute lifesaver!! Thank you so much, that worked!!!

 I'm fairly new at c# so customizing this application is painful for me, to say the least (I'm a VB.NET developer).

Thank you ever so much for helping me with this, as I was ready to jump off a cliff.