Sunday, September 22, 2013

Some Common Errors While We Use ASP .Net Controls

DropDownList.ClearSelection() to avoid "Cannot have multiple items selected in DropDownList"


ListItem item = DropDownListTest.Items.FindByValue("Test");
  if (item != null)
     item.Selected = true;
   

OR

dropDownList.ClearSelection();
dropDownList.Items.FindByValue(myValue).Selected = true;





0 comments:

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Powered by Code Imagine