DotNetNuke.Services.Exceptions.PageLoadException: Value cannot be null.

We experienced some problems with a DotNetNuke Site to do with the Page Load Exception.

Message: DotNetNuke.Services.Exceptions.PageLoadException: Value cannot be null. Parameter name: String —> System.ArgumentNullException: Value cannot be null. Parameter name: String at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) at System.Web.Configuration.HttpCapabilitiesBase.get_MajorVersion() at DotNetNuke.UI.Utilities.ClientAPI.BrowserSupportsFunctionality(ClientFunctionality eFunctionality) at Dnnskin.Net.SkinObjects.V2.HorizontalTheme.Page_Load(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) — End of inner exception stack trace —
and

Message: DotNetNuke.Services.Exceptions.PageLoadException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index —> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index at System.Collections.ArrayList.get_Item(Int32 index) at DotNetNuke.Modules.Forum.Posts.RenderThread(HtmlTextWriter wr) at DotNetNuke.Modules.Forum.Posts.Render(HtmlTextWriter wr) at DotNetNuke.Modules.Forum.ForumBaseControl.Render(HtmlTextWriter wr) 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.desktopmodules_forum_forum_container_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 DotNetNuke.Entities.Modules.PortalModuleBase.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.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.WebControls.WebControl.RenderContents(HtmlTextWriter writer) at System.Web.UI.WebControls.WebControl.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.HtmlControls.HtmlContainerControl.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 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.HtmlControls.HtmlContainerControl.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.portals__default_skins_vista_black_grayback_mediumwidth_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 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 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.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 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.HtmlControls.HtmlContainerControl.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.default_aspx.__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.Page.Render(HtmlTextWriter writer) at DotNetNuke.Framework.PageBase.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 —

Basically all these errors are assoicated with page load exceptions.

The root cause of these errors, and there were many happening with the site, was to do with the host settings / performance settings.

The Page State Persistence had been set to Memory. This is a bad idea in DNN website. We changed the setting back to “Page” and actually rebooted the server. This ensured things were all tidy and working again.

Unlock other user’s checked out files in TFS

Don’t you hate it? A developer is away on holiday the exact time you need to update some code in TFS only to find it checked out and locked by them. The other day while working on our unreleased DotNetNuke Module Easy Events – Event Calendar (example running here) this happened.

Open up a Visual Studio command prompt and run the following (replacing items with your details):

tf undo “$/PROJECTNAME/FOLDER/FILE.EXTENSION” /WORKSPACE:MYDEVBOXNAME;Domain\User /server:SERVERNAME /recursive

My Silverlight Image is not updating within my DNN Module

While working on our upcoming DotNetNuke Module Silverlight Video Library we came across an interesting thing where you would upload an image (replacing the image on the server if it existed already). This works well until we discovered Silverlight was caching the downloaded images.

Uploading and replacing an image on the server did nothing as the original jpg was cached. A simple command on the bitmap object allows us to get around and effectively bypass the cached image:

bitmap.CreateOptions = BitmapCreateOptions.IgnoreImageCache;

Download this DotNetNuke module from our website at: http://interactivewebs.com and stay tuned for our new release.

Extract image bitmap from Media Element in DNN Modules with Silverlight 3.0

For our upcoming new release of our DotNetNuke ModuleĀ Silverlight Video Library with silverlight 3, a feature which previously took more than a few third party dll’s and full trust just to extract a jpg from a wmv was a nightmare.

Now with silverlight 3 comes WriteableBitMap!

You will quickly fall in love with WriteableBitMap as in just 3 lines of code you can effectively take a screenshot of any UI element and make that the contents for an Image.

See below:

public WriteableBitmap GetBitmapFromItem(FrameworkElement ctl)
{
WriteableBitmap wb = new WriteableBitmap((int)ctl.ActualWidth, (int)ctl.ActualHeight);
wb.Render(ctl, new TranslateTransform());
wb.Invalidate();
return wb;
}

Now just use that as the Source object for an image and presto. Since this works for all UI elements, suddenly image reflection becomes a step easier. You could even set a timer object to refresh this every few milliseconds so you get a reflection of video without the overhead of 2 x Media Elements.

Download this DotNetNuke module from our website at: http://interactivewebs.com and stay tuned for our new release.

Our First InteractiveWebs Blog

This is the very first Blog we have made. Until now we are focused entirely on the world of custom DotNetNuke Modules, Microsoft CRM and xRM integration technologies and SilverLight 3.0.

With all the Free DNN Modules to publish for download from our site at http://www.interactivewebs.com and the custom module development work, we have never found the time to share so much as a thought to blogging.

The time has come, and we expect this blog to be a point of contact for people interested in our DotNetNuke skins, modules, and hosting, but also a place where we can share the expertise we have developed over many years of working with ASP.Net and other Microsoft Technologies.

We hope you enjoy reading what we have to share.