我希望能够从web.config文件中动态填充下面的3个列表项,如何在我的c#代码中执行此操作,而不是在html代码中对它们进行硬编码?
<EditItemTemplate>
<tr style="">
<td>
<asp:DropDownList ID="component" runat="server" AppendDataBoundItems="true" Text='<%# Bind("component") %>' >
<asp:ListItem>Choose a component</asp:ListItem>
<asp:ListItem>Component1</asp:ListItem>
<asp:ListItem>Component2</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
</EditItemTemplate>
protected void lvwOutput_ItemCommand(object sender, ListViewCommandEventArgs e)
{
string stop = "here";
if (e.CommandName == "Edit")
{
// what can I do here?
}
}