Tuesday, March 1, 2011

Dropdownlist database value to dropdownlist on page load

 for (int a = 0; a < DropDownList1.Items.Count; a++)
             {

                 if (DropDownList1.Items[a].Text == dr[7].ToString())
                 {
                     //string _text = DropDownList1.Items[a].Text;
                     DropDownList1.Items[a].Selected = true;

                 }
             }  

No comments:

Post a Comment