Question Control Enabled Property Not Working in Edge

mswanston

New member
Joined
Sep 1, 2020
Messages
2
Programming Experience
10+
Hi
I'm maintaining a legacy web application that was written 15+ years ago and has been partly updated to bring up more up to date over the years, so it may well be that the code that has been used is just 'out of date'?
The issue is based around a pair of dropdown controls, and the selected item in the first list determines whether the second list is enabled or not, i.e. if there is specific text in the selected item, then the user can select from the second list, otherwise it will be disabled.
Currently, this is the code and it works without issue in IE11, but testing it in Edge, the second control is not being disabled:
C#:
private static void CheckSAPS(object sender,
            WebControl ddlSaps)
        {
            var itemText = ((DropDownList)sender).SelectedItem.Text;
            var sapsControl = (DropDownList)ddlSaps;
            // has a SAPS item been selected?
            var showControl = itemText.StartsWith("SAPS", StringComparison.InvariantCultureIgnoreCase);
            // if not, reset the associated control to blank
            if (!showControl) sapsControl.SelectedIndex = 0;
            // and disable/enable it
            sapsControl.Enabled = showControl;
        }
I have looked at using the list control extension 'Disable()', but can't figure out how to revert the control to be enabled when the user selects an item that starts with the text "SAPS", but it may be there is something I'm missing about the original code?
Any help or advice gratefully received, as this style of logic has been used throughout the application, and if it's going to start failing in Edge, there is a fair amount of work ahead to resolve it across the board.
Many thanks
Martin
 
Hi. I've not been able to debug in Edge as the pages don't render correctly, yet it looks correct when accessing the deployed version. I'll investigate and look to see if I can figure out what the Enabled value is. Thanks
 
Back
Top Bottom