Take the community feedback survey now.
Take the community feedback survey now.
Hi Sammyender,
This looks like an issue with how the Optimizely editor handles [SelectOne] options when the value is a numeric string (e.g., "1", "2", "3").
The value is saved correctly to the database, but when the editor reloads, the UI-side selection component fails to match the stored value with the list of options — which is why the dropdown shows as unselected.
This is a known limitation with the current implementation of SelectOne.
Here are a few reliable approaches until the UI handling is updated:
1. Use non-numeric string values
Instead of "1" / "2" / "3", use "Option1" / "Option2" or meaningful codes.
These bind correctly and the editor displays the selected value without issues.
2. Use an enum with [SelectOne] or BackingType = typeof(string)
Enums avoid the value-type mismatch and work well with selection editors.
3. Prefix numbers to keep them purely string values
Example: "v1", "v2", "v3"
This also prevents the framework from interpreting the value as a number.
Thanks,
The editor view fails to load the stored value of a property that has a [SelectOne] attribute when the options value is a number as string ("1", "2", "3", etc). Selections are stored correctly on save/publish but the JS framework fails to load and display the selection