2013-02-20 52 views
0

我創造了一個自定義的數據類型一把umbraco但是當我在一把umbraco節點運行它,它給了我一個錯誤錯誤一把umbraco用戶控件使用一把umbraco用戶控件包裝包裝器

At /umbraco/editContent.aspx?id=2969 (Referred by: http://aksp:201/umbraco/umbraco.aspx): System.InvalidCastException: Unable to cast object of type 'ASP.usercontrols_shopdata_ascx' to type 'umbraco.editorControls.userControlGrapper.IUsercontrolDataEditor'.  at umbraco.editorControls.userControlGrapper.usercontrolDataEditor.OnInit(EventArgs e)  at System.Web.UI.Control.InitRecursive(Control namingContainer)  at System.Web.UI.Control.InitRecursive(Control namingContainer)  at System.Web.UI.Control.InitRecursive(Control namingContainer)  at System.Web.UI.Control.InitRecursive(Control namingContainer)  at System.Web.UI.Control.InitRecursive(Control namingContainer)  at System.Web.UI.Control.AddedControl(Control control, Int32 index)  at umbraco.controls.ContentControl.addControlNew(Property p, TabPage tp, String Caption)  at umbraco.controls.ContentControl.CreateChildControls()  at System.Web.UI.Control.EnsureChildControls()  at umbraco.controls.ContentControl.OnInit(EventArgs e)  at System.Web.UI.Control.InitRecursive(Control namingContainer)  at System.Web.UI.Control.AddedControl(Control control, Int32 index)  at umbraco.cms.presentation.editContent.OnInit(EventArgs e)  at System.Web.UI.Control.InitRecursive(Control namingContainer)  at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 

我不知道哪裏出了問題?

回答

2

這是一個無效的演員,它試圖將您的自定義shopdata usercontrol轉換爲無效的IUsercontrolDataEditor

確保您的控件實現umbraco.editorControls.userControlGrapper.IUsercontrolDataEditor接口

Herehere是關於如何創建具有UmbracoUsercontrol包裝的自定義數據類型好指南。