This project is read-only.

Unable to cast object of type 'ASP.widgets_blogroll_widget_ascx' to type 'WidgetBase'.

Feb 3, 2009 at 7:03 PM
This was working at one point, but now when I try to add the BlogRoller I get the following error. Any ideas what I should look into?

Server Error in '/blog' Application.

Unable to cast object of type 'ASP.widgets_blogroll_widget_ascx' to type 'WidgetBase'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidCastException: Unable to cast object of type 'ASP.widgets_blogroll_widget_ascx' to type 'WidgetBase'.

Source Error:

Line 120: private void AddWidget(string type)
Line 121: {
Line 122:  WidgetBase widget = (WidgetBase)LoadControl(Utils.RelativeWebRoot + "widgets/" + type + "/widget.ascx");
Line 123:  widget.WidgetID = Guid.NewGuid();
Line 124:  widget.ID = widget.WidgetID.ToString().Replace("-", string.Empty);

Source File: \blog\admin\WidgetEditor.aspx.cs    Line: 122

Stack Trace:

[InvalidCastException: Unable to cast object of type 'ASP.widgets_blogroll_widget_ascx' to type 'WidgetBase'.]
   User_controls_WidgetEditor.AddWidget(String type) in \blog\admin\WidgetEditor.aspx.cs:122
   User_controls_WidgetEditor.Page_Init(Object sender, EventArgs e) in \blog\admin\WidgetEditor.aspx.cs:49
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnInit(EventArgs e) +99
   System.Web.UI.Page.OnInit(EventArgs e) +12
   System.Web.UI.Control.InitRecursive(Control namingContainer) +333
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +378