举例 :取出a,b等内容(内容是动态的)
<asp:DropDownList ID="attachments" runat="server">
<asp:ListItem Value="-1" Selected="True">附 件 清 单...</asp:ListItem>
<asp:ListItem>a</asp:ListItem>
<asp:ListItem>b</asp:ListItem>
</asp:DropDownList>
<asp:DropDownList ID="attachments" runat="server">
<asp:ListItem Value="-1" Selected="True">附 件 清 单...</asp:ListItem>
<asp:ListItem>a</asp:ListItem>
<asp:ListItem>b</asp:ListItem>
</asp:DropDownList>
Response.Write(attachments.SelectedItem.Text);
如果要在前台取則js如下:var attachments = document.getElementById("attachments");var text = attachments.options[attachments.selectedIndex].text
string mm = "";
foreach(ListItem item in this.attachments.Items)
{
mm += item.Value;
}return mm;
---------------------------------------------
EMail:[email protected] 请给我一个与您交流的机会!