Your website contains a lot of DropDownList in several pages. To save times, you can put the following code into the App_Code and call when needed.
public void SetDataToDropDown(DropDownList drdn, int iValue)
{
for (int i = 0; i <>
{
if (drdn.Items[i].Value == iValue.ToString())
{
drdn.SelectedIndex = i;
break;
}
}
}
public void SetDataToDropDown(DropDownList drdn, int iValue)
{
for (int i = 0; i <>
{
if (drdn.Items[i].Value == iValue.ToString())
{
drdn.SelectedIndex = i;
break;
}
}
}
Comments
Post a Comment