我们可以使用以下语法在asp.net组件中制作下拉列表
<asp:DropDownList ID="test" runat="server">
<asp:ListItem Text="1" Value="1"></asp:ListItem>
</asp:DropDownList>
Run Code Online (Sandbox Code Playgroud)
如果我们希望我们的组合框包含 1 到 1000,有没有办法用 foreach 循环填充它,而不是手动向其中添加 1000 项?