Tuesday, May 1, 2012

DropDownList value set By FindBy ASP.NET Example

In asp.net there are two ways to FindBy DropdownList. 1.FindByValue and 2.FindByText In FindByValue if more then one List Item text is same then it is working Properly also.
ddlDropDownList.Items.FindByValue(strSearchText).Selected = true;
In FindByText ASP.NET In FindByText if more then one List Item text is same then it is not working Properly also.
ddlDropDownList.Items.FindByText(strSearchText).Selected = true;
There is also other way to DropDownList Select Value through Text but this is Best Way. That's why I choose it.
ASPdotNET-Example