I have
public class ListA
{
private string code;
private string name;
public string Code { get { return code; } set { code = value; } }
public string Name { get { return name; } set { name = value; } }
}
I am populating the dropdownlist with code:name.
and I have an asp:label in which I want to show only Name that is selected in the dropdownlist.
How can I do that?
Set your DropDownList
DataValueField = "Name"and then use
myLabel.Text = myDropDownList.SelectedValue;