ASP.NET Dropdown list
Posted on 2015-01-27
How to display a value in the dropdownlist . I have a dropdown list where I have 2 values. 'Yes' and 'No'. But sometimes I need to display the value from the DB. Right now I am using this code.
If Reader.Item("Active") = "Y" Then
ddlCustActive.SelectedItem.Text = "Yes"
ddlCustActive.SelectedItem.Text = "No"
It is working. but changing the selected item text in the list and displaying either two 'yes' or two 'no'