How to SELECT a drop down list item by value programatically in C#.NET?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Generic Generics in Managed C++
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
This is a simple way to select an option from a dropdownlist based on a string val
I prefer
Replace ddl with the dropdownlist ID and string with your string variable name or value.
I suspect you may want yo hear something else, but this is what you asked for.
Ian Boyd (above) had a great answer -- Add this to Ian Boyd's class "WebExtensions" to select an item in a dropdownlist based on text:
To call it: