I am working on an Asp.NET project and I am trying to set the selected value of a dropdown list with a text property. For example i have i.e an item in the dropdown list with text test. Programmatically can i set it to selecteditem by Text?. I am using the follwing code but is not working.
protected void Page_Load(object sender, EventArgs e)
{
string t = "test";
drpFunction.Text = t;
}
But is not working. Any suggestions ?
1 Answer