Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Hi Benny,
While i am using your code it is giving error in the line
System.Collections.ArrayList al = FormControl.ExtractXFormControls();
stating that [FormControl does not exist in the current context]
Can u figure out how to overcome this?
private void SetFormMode(bool isEnabled) { System.Collections.ArrayList al = FormControl.ExtractXFormControls(); for (int i = 0; i < al.Count; i++) { if (al[i].GetType() == typeof(EPiServer.XForms.WebControls.Input)) { EPiServer.XForms.WebControls.Input input = (EPiServer.XForms.WebControls.Input)al[i]; input.Enabled = isEnabled; } if (al[i].GetType() == typeof(EPiServer.XForms.WebControls.Label)) { EPiServer.XForms.WebControls.Label label = (EPiServer.XForms.WebControls.Label)al[i]; label.Enabled = isEnabled; } if (al[i].GetType() == typeof(EPiServer.XForms.WebControls.Select)) { EPiServer.XForms.WebControls.Select select = (EPiServer.XForms.WebControls.Select)al[i]; select.Enabled = isEnabled; } if (al[i].GetType() == typeof(EPiServer.XForms.WebControls.Select1)) { EPiServer.XForms.WebControls.Select1 select1 = (EPiServer.XForms.WebControls.Select1)al[i]; select1.Enabled = isEnabled; } if (al[i].GetType() == typeof(EPiServer.XForms.WebControls.SelectControl)) { EPiServer.XForms.WebControls.SelectControl selectControl = (EPiServer.XForms.WebControls.SelectControl)al[i]; selectControl.Enabled = isEnabled; } if (al[i].GetType() == typeof(EPiServer.XForms.WebControls.Text)) { EPiServer.XForms.WebControls.Text text = (EPiServer.XForms.WebControls.Text)al[i]; text.Enabled = isEnabled; } if (al[i].GetType() == typeof(EPiServer.XForms.WebControls.TextArea)) { EPiServer.XForms.WebControls.TextArea textArea = (EPiServer.XForms.WebControls.TextArea)al[i]; textArea.Enabled = isEnabled; } if (al[i].GetType() == typeof(EPiServer.XForms.WebControls.Submit)) { EPiServer.XForms.WebControls.Submit submit = (EPiServer.XForms.WebControls.Submit)al[i]; submit.Enabled = isEnabled; } } }