API
Version 7.x > API > Checkbox list Custom CMS Form user control View modes: 
User avatar
Member
Member
rooossone - 12/9/2013 8:23:39 AM
   
Checkbox list Custom CMS Form user control
Hi All,

I have used the following two sources to try and achieve what I need:

http://devnet.kentico.com/Forums.aspx?forumid=62&threadid=28842
&
http://devnet.kentico.com/docs/devguide/index.html?developing_form_controls.htm

I am trying to populate the list with a collection of values I draw from a Db table. I then want the selected values to be stored by ketico for later use via the API.

The page_load event ensures that the checkbox list contains items. I think where I start getting confused is how I need to override Value and IsValid to created this comma separated list of selected values to store in kentico.

I have been able to build it and add the control in kentico, I am also confused and unable to find much information on the meaning and context of the control scope fields and also the properties on the next tab.

I followed what was described in the documentation and added the control to a doc type's form. when i goto edit data i just get a message saying there was an error loading the control and i get no further info, I also tried debugging kentico to run through it step by step and no luck in tracking my problems....

My question is essentially, I Know I am doing something wrong so how do i set up a checkboxlist user control in kentico? can anybody provide some demo code dealing with this or point me in the right direction?

User avatar
Member
Member
rooossone - 12/15/2013 12:43:20 PM
   
RE:Checkbox list Custom CMS Form user control
Hi Again,

So I decided to go back to basics and see if I could create ANY form control...
http://devnet.kentico.com/docs/devguide/index.html?developing_form_controls.htm

I followed the above guide to the letter. However, I am seeing the same error appear on the Doc type form. where it is failing to load the Type of the control.... I can provide the associated event log as well....
Source: FormEngine

EventCode: LOADFORMCONTROL

UserName: administrator

IPAddress: ::1

EventDescription: Message: Could not load type 'CMSApp.CMSFormControls.TestControl'.
Stack Trace:
at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding)
at System.Web.UI.TemplateParser.ParseFile(String physicalPath, VirtualPath virtualPath)
at System.Web.UI.TemplateParser.Parse()
at System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType()
at System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider)
at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders()
at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)
at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate)
at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath)
at CMS.FormControls.EditingFormControl.InitializeControl(FormUserControlInfo ci, String controlCodeName, FormFieldInfo ffi, String defaultValue, Object value)
at CMS.FormControls.EditingFormControl.CreateControl(FormFieldInfo ffi)

Could not load type 'CMSApp.CMSFormControls.TestControl'.
at System.Web.UI.TemplateParser.ProcessException(Exception ex)
at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)
at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding)

Could not load type 'CMSApp.CMSFormControls.TestControl'.
at System.Web.UI.TemplateParser.GetType(String typeName, Boolean ignoreCase, Boolean throwOnError)
at System.Web.UI.TemplateParser.ProcessInheritsAttribute(String baseTypeName, String codeFileBaseTypeName, String src, Assembly assembly)
at System.Web.UI.TemplateParser.PostProcessMainDirectiveAttributes(IDictionary parseData)

This is incredibly frustrating as there really isn't any more information out there regarding the creation of custom form controls and the errors I see a far less than informative imo.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 12/22/2013 3:10:51 AM
   
RE:Checkbox list Custom CMS Form user control
Hello,

Could you please post also the code of your form control so we can check it?
Also, how it was registered in the Site manager? What are the properties set when added to a document type fields definition?

Usually following the documentation works and it is the way how to create a form control.

Thank you!

Best regards,
Juraj Ondrus