2013-02-20 54 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包装的自定义数据类型好指南。