No parameterless constructor defined for this object
Hello,
I'm having some issues with a control that we have developed. The control is a general item selector for use in the back-end of sitefinity, specifically in custom modules. This selector is currently being used in one of our custom modules without any issues whatsoever. I attempted to re-use it in another custom module, and i ran into issues (When I say "Custom Module" I mean a module made base on the products module in the SDK, not a module made in the module builder). I get the following error after clicking on one of my items in my module from the listing in Sitefinity:
No parameterless constructor defined for this object.
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.MissingMethodException: No parameterless constructor defined for this object.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[MissingMethodException: No parameterless constructor defined for this object.]
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache) +98
System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache) +241
System.Activator.CreateInstance(Type type, Boolean nonPublic) +69
Telerik.Sitefinity.Web.UI.FieldFactory.GetFieldControl(IFieldDefinition definition) +110
Telerik.Sitefinity.Web.UI.ContentUI.Views.Backend.Detail.SectionControl.FieldsRepeater_ItemDataBound(Object sender, RepeaterItemEventArgs e) +258
System.Web.UI.WebControls.Repeater.OnItemDataBound(RepeaterItemEventArgs e) +115
System.Web.UI.WebControls.Repeater.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) +138
System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +478
System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +61
System.Web.UI.WebControls.Repeater.DataBind() +76
System.Web.UI.Control.DataBindChildren() +201
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +101
System.Web.UI.Control.DataBind() +15
System.Web.UI.Control.DataBindChildren() +201
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +101
System.Web.UI.Control.DataBind() +15
System.Web.UI.Control.DataBindChildren() +201
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +101
System.Web.UI.Control.DataBind() +15
System.Web.UI.Control.DataBindChildren() +201
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +101
System.Web.UI.Control.DataBind() +15
System.Web.UI.Control.DataBindChildren() +201
System.Web.UI.WebControls.CompositeControl.DataBind() +50
System.Web.UI.Control.DataBindChildren() +201
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +101
System.Web.UI.Control.DataBind() +15
System.Web.UI.WebControls.Repeater.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) +127
System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +478
System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +61
System.Web.UI.WebControls.Repeater.DataBind() +76
Telerik.Sitefinity.Web.UI.ContentUI.Views.Backend.Detail.DetailFormView.SetUpSections(IEnumerable`1 sections) +148
Telerik.Sitefinity.Web.UI.ContentUI.Views.Backend.Detail.DetailFormView.OnPreRender(EventArgs e) +81
System.Web.UI.Control.PreRenderRecursiveInternal() +103
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2496
var doctorsField =
new
RelatedItemsElement(doctorsSection.Fields)
ID =
"doctorsField"
,
DataFieldName =
"Doctors"
,
DisplayMode = displayMode,
Title =
"DoctorsToSetupFieldTitle"
,
WrapperTag = HtmlTextWriterTag.Li,
ResourceClassId =
typeof
(LocationsResources).Name,
FieldType =
typeof
(RelatedItemsElement),
RelatedItemDataServicePath =
"~/Sitefinity/Services/DynamicModules/Data.svc/"
,
RelatedItemType =
"Telerik.Sitefinity.DynamicTypes.Model.DoctorBios.DoctorBio"
,
SelectedItemsTemplate = @
"<li><span data-bind='text: DoctorName'></span> <a href='#' class='remove'>Remove</a></li>"
,
ListModeClientTemplate = @
"<strong class='sfItemTitle'>DoctorName</strong>"
,
;
doctorsSection.Fields.Add(doctorsField);