What happened - Blogengine default.aspx loads garbage

Topics: Business Logic Layer, Themes
Aug 27, 2009 at 11:34 PM

I was making what I thought was a minor change to my theme.  When I reloaded blogengine, I saw this:

Blogengine Garbage Image

Does anyone have any idea what I did / happened?

I did turn customerror mode = "off" and don't really see anything different.  I'm also able to reset my theme by editing settings.xml and resort back to a standard theme.

Thanks in advance for your help.

Coordinator
Aug 28, 2009 at 2:47 AM

Changing the customErrors tag is a good first step.  For the garbage characters, if you edit the Global.asax file in your root folder, add the Application_Error error handler I posted code for in this thread on April 23rd.  You should then get a real error message.

On a side note, although this doesn't help you, one of the recent builds of BE already includes this error handling in Global.asax.  So future releases of BE will already have this code in Global.asax and garbage characters shouldn't occur anymore.

Aug 28, 2009 at 4:19 AM

This happened all the time to me when I was developing my theme. I had to comment out the code behind to get it fixed.

Aug 28, 2009 at 7:14 PM

Ok, here's an update.  I've added the code to global.asax as suggested by BenAmada.  Sorry, I'm not a developer so I'm not sure what / where is the code behind that should get commented out.  I can tell you that I started seeing the garbage when I was trying to comment out some of the script in the theme.

The garbage screen reappeared again even thought I wasn't editing the theme.  Today, I was maintaining my Blogroll specifically, adding some blogroll entries.  2 things are happening.  First, after I made the additions (I see all my blogrolls at the bottom of the blogroll maintenance screen) I pressed "Go to frontpage".  The frontpage appeared but none of my new blog entries appeared.  Note at this time I'm still logged in to administer my blog.  I can change themes, still no new blogroll entries.  But no errors.

Second, when I close IE and then reopen my blog, I get this:

System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.UriFormatException: Invalid URI: The hostname could not be parsed. at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind) at System.Uri..ctor(String uriString) at System.Net.WebRequest.Create(String requestUriString) at Controls.Blogroll.AddBlog(String name, String description, String feedUrl, String website, String xfn) at Controls.Blogroll.CreateList() at Controls.Blogroll.DisplayBlogroll() at Controls.Blogroll.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at ASP.widgets_blogroll_widget_ascx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.Control.Render(HtmlTextWriter writer) at WidgetBase.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.Control.Render(HtmlTextWriter writer) at Controls.WidgetZone.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at ASP.themes_standard_site_master.__Render__control5(HtmlTextWriter __w, Control parameterContainer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) at System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) at ASP.themes_standard_site_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.Control.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.Page.Render(HtmlTextWriter writer) at BlogEngine.Core.Web.Controls.BlogBasePage.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace --- at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.default_aspx.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

I assume this is the error message detail BenAmada's code in global.asax generated but have no idea what it means.

The other thing is that I can get back into my blog.  If i use the url: http://myblogname.com/login.aspx, the admin login page appears as I'd expect.  I can go to the admin pages, and then choose logout.  Once I do that, my blog is running again EXCEPT my blogroll still doesn't show the new blogroll entries.  That said, when I look inside blogroll.xml in /app_data all my blogroll entries are listed (so I don't think it has anything to do with read/write permissions).

Any additional help insight would be most appreciated.

Aug 28, 2009 at 7:25 PM

An update - I found the reason why the garbage appeard in this case.  This may be a bug in Blogengine and is most certainly some sort of user interface data validation issue.  The problem I believe is that I put an apostrophe in the RSS url field.  Instead of putting a valid url, I typed in, "I don't know".  When I typed only "I dont know" or used the blogroll item's site url in the RSS url, things worked fine - including being able to see ALL my blogroll entries.