为DropDownList动态添加第一项

private static void InsertDdlFirstItem(DropDownList ddlObject)
        {
            ListItem firstItem = new ListItem();
            firstItem.Value = "";
            firstItem.Text = "--请选择--";
            firstItem.Selected = true;
            ddlObject.Items.Insert(0, firstItem);
        }

你可能感兴趣的:(java)