选中时如何在下拉列表中上移项目? [英] How Do I Move Up An Item In An Drop Down List When Its Selected?

查看:90
本文介绍了选中时如何在下拉列表中上移项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<asp:DropDownList ID="DDSortBy" runat="server" AutoPostBack="true"  CssClass="RightDD" OnSelectedIndexChanged="DDSortBy_SelectedIndexChanged">
                <asp:ListItem Value="0">Random</asp:ListItem>
                <asp:ListItem Value="1">Album</asp:ListItem>
                <asp:ListItem Value="2">Artist</asp:ListItem>
                <asp:ListItem Value="3">Price</asp:ListItem>
                <asp:ListItem Value="4">Top Rated</asp:ListItem>
                <asp:ListItem Value="5">Year</asp:ListItem>
            </asp:DropDownList>

推荐答案

项目列表应填入文件后面的代码中,然后在回发后事件中重新排序。
The list of items should be populated in code behind file and on post back event you can then re-order them.


这篇关于选中时如何在下拉列表中上移项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆