Technical support This forum is closed.
Version 1.x > Technical support > BUG: Custom Controls in BasicForm.cs View modes: 
User avatar
Member
Member
wtijsma - 2/8/2005 5:30:04 PM
   
BUG: Custom Controls in BasicForm.cs
I've replaced a part in BasicForm.cs that loads the custom user control with this:

case "usercontrol":
string controlName = formNode.SelectSingleNode("settings/controlname").InnerText;
try
{
string controlPath = ConfigurationSettings.AppSettings["CMSMetadataFolder"] + @"/_CustomFormControls/" + controlName;
usrControl = ((KentiFormUserControl) (this.Page.LoadControl(controlPath)));
}
catch //(Exception ex)
{
string controlPath = "~/cmsdesk/metadata/_CustomFormControls/" + controlName;
usrControl = ((KentiFormUserControl) (this.Page.LoadControl(controlPath)));
}
usrControl.ID = GetAttributeValue(formNode, "column");
usrControl.Value = GetDataRowValue(formNode);
usrControl.DataDR = dr;
Controls.Add(usrControl);
break;

I've extracted some variables, and solved a bug

@"/_CustomFormControls/"

was

@"\_CustomFormControls\"

and gave an exception. The catch fallback doesn't work with me because my CMSDesk runs in it's own IIS application.

One code-style related comment: could you make the commands a little shorter? extract more variables? that would make debugging somewhat easier...

Thanks!

Wiebe

User avatar
Guest
admin - 2/10/2005 9:22:29 AM
   
Re: BUG: Custom Controls in BasicForm.cs
Hi Wiebe,

thank you for notifying us about this bug. We have made the same change in our code, so it will be fixed in the nearest release.

Thank you.