To Check if the dropdownlist has a given value before selecting it:
ListItem li = ddlItems.Items.FindByValue(MyNr.ToString());
if (li != null) //Item Found in dropdown..so select it and display details
{
//Value was found
}
else
{ //not found }
No comments:
Post a Comment