代码如下:
//根据Value选择Select项(slcAnmCategory为Html Select)
for (int i = 0; i < slcAnmCategory.Items.Count; i++)
{
if (slcAnmCategory.Items[i].Value == sCategory)
{
slcAnmCategory.SelectedIndex = i;
}
}
for (int i = 0; i < slcAnmCategory.Items.Count; i++)
{
if (slcAnmCategory.Items[i].Value == sCategory)
{
slcAnmCategory.SelectedIndex = i;
}
}
前台选择方法:
slcAnmCategory.Value =1;