Skip to content

Instantly share code, notes, and snippets.

@yushiro
Created May 22, 2013 07:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yushiro/5625922 to your computer and use it in GitHub Desktop.
Save yushiro/5625922 to your computer and use it in GitHub Desktop.
ASP.NET中,根据DropDownList的Value选中对应的Item
<asp:DropDownList ID="ddlOrderStatus" runat="server" >
<asp:ListItem Text="所有" Value="-1"></asp:ListItem>
<asp:ListItem Text="未激活" Value="1"></asp:ListItem>
<asp:ListItem Text="激活" Value="1_1"></asp:ListItem>
<asp:ListItem Text="发至物流" Value="2"></asp:ListItem>
<asp:ListItem Text="完成" Value="3"></asp:ListItem>
</asp:DropDownList>
DropDownList.Items.FindByValue("3").Selected = true;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment