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
|