aspx Tutorial

.NET Articles,jQuery demo, asp.net with jQuery, online tutorial,Jquery, SilverLight, Javascript, asp.net,JSON, MVC,.NET Articles,demo, Web Services, .NET articles, Sharepoint 2010, visual studio 2010,Aamir Hasan,IT, Building Your First Web Application Project
Advertise Here

Toolbar

Get our toolbar!

Advertize



Posted by Aamir Hasan   on Friday, July 22, 2011 Total Views:  

In this example, I will tell you how to sort ASP.NET ListBox items with jQuery when button will be clicked. Using Jquery it is easy to sort items on client side.

Here’s an example

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

    <title>Sorting ASP.NET ListBox using jQuery</title>

    <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.2.min.js" type="text/javascript"></script>

    <script type="text/javascript">

        $(function () {

            $("#btnClick").click(function () {

                $("#<%=ListBox1.ClientID %>").html($("#<%=ListBox1.ClientID %> option").sort(function (a, b) {

                    return a.text == b.text ? 0 : a.text < b.text ? -1 : 1

                }))

            });

        });

    </script>

</head>

<body>

    <form id="form1" runat="server">

    <div>

        <asp:ListBox ID="ListBox1" runat="server" Rows="8">

            <asp:ListItem Value="3">ORANGE</asp:ListItem>

            <asp:ListItem Value="2">BANANA</asp:ListItem>

            <asp:ListItem Value="4">MANGO</asp:ListItem>

            <asp:ListItem Value="1">APPLE</asp:ListItem>

            <asp:ListItem Value="5">RAMBUTAN</asp:ListItem>

            <asp:ListItem Value="6">ROSELLE</asp:ListItem>

            <asp:ListItem Value="7">SAPODILLA</asp:ListItem>

            <asp:ListItem Value="8">STARFRUIT</asp:ListItem>

            <asp:ListItem Value="9">TAMARIND</asp:ListItem>

        </asp:ListBox>

        <br />

        <input id="btnClick" type="button" value=" Click " />

    </div>

    </form>

</body>

</html>

Output

Download

Sort-ListBox-jQuery.aspx (1.53 kb)

See live demo

 

Category: All | Control | jQuery
Protected by Copyscape Online Plagiarism Tool

Comments (1) -

burberryoutlet
burberryoutlet People's Republic of China
7/12/2013 2:13:09 PM #

<a href="code.google.com/.../"><strong>Cheap Toms</strong></a> designer labels <a href="code.google.com/.../"><strong>Toms Outlet</strong></a> designer labels <a href="code.google.com/.../"><strong>Cheap Toms</strong></a> designer labels <a href="code.google.com/.../"><strong>Toms Outlet</strong></a> designer labels <a href="code.google.com/.../"><strong>Cheap Toms</strong></a> designer labels <a href="code.google.com/.../"><strong>Toms Outlet</strong></a> designer labels <a href="code.google.com/.../"><strong>Jeremy Scott Wings</strong></a> designer labels <a href="code.google.com/.../"><strong>Jeremy Scott Shoes</strong></a> designer labels <a href="code.google.com/.../"><strong>Adidas Jeremy Scott</strong></a> designer labels <a href="code.google.com/.../"><strong>Cheap Toms</strong></a> designer labels <a href="code.google.com/.../"><strong>Toms Outlet</strong></a> designer labels <a href="code.google.com/.../"><strong>Cheap Toms</strong></a> designer labels <a href="code.google.com/.../"><strong>Toms Outlet</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Outlet</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Outlet</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Outlet Online</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Outlet</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Outlet Store</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Outlet</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Outlet Store</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Outlet Online</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Outlet</strong></a> designer labels <a href="sites.google.com/.../"><strong>Toms Outlet</strong></a> designer labels <a href="sites.google.com/.../"><strong>Cheap Toms</strong></a> designer labels <a href="sites.google.com/.../"><strong>Toms Outlet</strong></a> designer labels <a href="burberry-outlet-onlines.tumblr.com/"><strong>Burberry Outlet Online</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Outlet</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Outlet Online</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Watches</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Rain Boots</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Outlet</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Handbags</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Sale</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Sales</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Outlet</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Outlet Online</strong></a> designer labels <a href="code.google.com/.../"><strong>Adidas Jeremy Scott</strong></a> designer labels <a href="code.google.com/.../"><strong>Jeremy Scott Adidas</strong></a> designer labels <a href="code.google.com/.../"><strong>Jeremy Scott Wings</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Outlet</strong></a> designer labels <a href="code.google.com/.../"><strong>Cheap Toms</strong></a> designer labels <a href="code.google.com/.../"><strong>Toms Outlet</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Outlet</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Outlet Store</strong></a> designer labels <a href="sites.google.com/.../"><strong>Burberry Outlet</strong></a> designer labels <a href="sites.google.com/.../"><strong>Burberry Outlet Online</strong></a> designer labels <a href="ieia.in/...let.asp"><strong>Burberry Outlet</strong></a> designer labels <a href="ieia.in/...let.asp"><strong>Burberry Outlet Online</strong></a> designer labels <a href="ieia.in/...let.asp"><strong>Burberry Outlet Store</strong></a> designer labels <a href="www.cnbchotels.com/burberryoutlet.asp"><strong>Burberry Outlet</strong></a> designer labels <a href="www.cnbchotels.com/burberryoutlet.asp"><strong>Burberry Outlet Online</strong></a> designer labels <a href="www.cnbchotels.com/burberryoutlet.asp"><strong>Burberry Outlet Store</strong></a> designer labels <a href="www.thekennygallery.ie/burberryoutlet.asp"><strong>Burberry Outlet</strong></a> designer labels <a href="www.thekennygallery.ie/burberryoutlet.asp"><strong>Burberry Outlet Online</strong></a> designer labels <a href="www.thekennygallery.ie/burberryoutlet.asp"><strong>Burberry Outlet Store</strong></a> designer labels <a href="www.fruitsbear.jp/.../tomsoutlet.html"><strong>Toms Outlet</strong></a> designer labels <a href="www.fruitsbear.jp/.../tomsoutlet.html"><strong>Cheap Toms</strong></a> designer labels <a href="www.fruitsbear.jp/.../tomsoutlet.html"><strong>Toms Shoes Outlet</strong></a> designer labels <a href="www.fruitsbear.jp/.../cheaptoms.html"><strong>Toms Outlet</strong></a> designer labels <a href="www.fruitsbear.jp/.../cheaptoms.html"><strong>Cheap Toms</strong></a> designer labels <a href="www.fruitsbear.jp/.../cheaptoms.html"><strong>Toms Shoes Outlet</strong></a> designer labels <a href="tvmax-9.com/poms.asp"><strong>Burberry Outlet</strong></a> designer labels <a href="tvmax-9.com/poms.asp"><strong>Burberry Outlet Online</strong></a> designer labels <a href="www.africabio.com/.../views.php"><strong>Burberry Outlet</strong></a> designer labels <a href="www.africabio.com/.../views.php"><strong>Burberry t shirt</strong></a> designer labels <a href="www.wovv.org/burberry-outlet.asp"><strong>Burberry Sale</strong></a> designer labels <a href="www.wovv.org/burberry-outlet.asp"><strong>Burberry Watches</strong></a> designer labels <a href="www.megabites.com.sg/sitemaps.html"><strong>Burberry Outlet</strong></a> designer labels <a href="www.megabites.com.sg/sitemaps.html"><strong>Burberry Outlet Store</strong></a> designer labels <a href="www.betterrugbycoaching.com/burberry-outlet.asp"><strong>Burberry Outlet</strong></a> designer labels <a href="www.betterrugbycoaching.com/burberry-outlet.asp"><strong>Burberry Outlet Online</strong></a> designer labels <a href="www.betterrugbycoaching.com/burberry-outlet.asp"><strong>Burberry Outlet Online store</strong></a> designer labels <a href="www.zhunmum.com/.../tomsoutlet.html"><strong>Toms Outlet</strong></a> designer labels <a href="www.zhunmum.com/.../tomsoutlet.html"><strong>Cheap Toms</strong></a> designer labels <a href="www.spindle.net/.../rss.asp"><strong>Toms Outlet</strong></a> designer labels <a href="www.spindle.net/.../rss.asp"><strong>Cheap Toms</strong></a> designer labels <a href="newshoesonlines.webs.com/"><strong>Toms Outlet</strong></a>

burberryoutlet
burberryoutlet People's Republic of China
7/12/2013 2:30:17 PM #

<a href="code.google.com/.../"><strong>Cheap Toms</strong></a> designer labels <a href="code.google.com/.../"><strong>Toms Outlet</strong></a> designer labels <a href="code.google.com/.../"><strong>Cheap Toms</strong></a> designer labels <a href="code.google.com/.../"><strong>Toms Outlet</strong></a> designer labels <a href="code.google.com/.../"><strong>Cheap Toms</strong></a> designer labels <a href="code.google.com/.../"><strong>Toms Outlet</strong></a> designer labels <a href="code.google.com/.../"><strong>Jeremy Scott Wings</strong></a> designer labels <a href="code.google.com/.../"><strong>Jeremy Scott Shoes</strong></a> designer labels <a href="code.google.com/.../"><strong>Adidas Jeremy Scott</strong></a> designer labels <a href="code.google.com/.../"><strong>Cheap Toms</strong></a> designer labels <a href="code.google.com/.../"><strong>Toms Outlet</strong></a> designer labels <a href="code.google.com/.../"><strong>Cheap Toms</strong></a> designer labels <a href="code.google.com/.../"><strong>Toms Outlet</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Outlet</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Outlet</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Outlet Online</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Outlet</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Outlet Store</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Outlet</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Outlet Store</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Outlet Online</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Outlet</strong></a> designer labels <a href="sites.google.com/.../"><strong>Toms Outlet</strong></a> designer labels <a href="sites.google.com/.../"><strong>Cheap Toms</strong></a> designer labels <a href="sites.google.com/.../"><strong>Toms Outlet</strong></a> designer labels <a href="burberry-outlet-onlines.tumblr.com/"><strong>Burberry Outlet Online</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Outlet</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Outlet Online</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Watches</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Rain Boots</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Outlet</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Handbags</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Sale</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Sales</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Outlet</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Outlet Online</strong></a> designer labels <a href="code.google.com/.../"><strong>Adidas Jeremy Scott</strong></a> designer labels <a href="code.google.com/.../"><strong>Jeremy Scott Adidas</strong></a> designer labels <a href="code.google.com/.../"><strong>Jeremy Scott Wings</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Outlet</strong></a> designer labels <a href="code.google.com/.../"><strong>Cheap Toms</strong></a> designer labels <a href="code.google.com/.../"><strong>Toms Outlet</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Outlet</strong></a> designer labels <a href="code.google.com/.../"><strong>Burberry Outlet Store</strong></a> designer labels <a href="sites.google.com/.../"><strong>Burberry Outlet</strong></a> designer labels <a href="sites.google.com/.../"><strong>Burberry Outlet Online</strong></a> designer labels <a href="ieia.in/...let.asp"><strong>Burberry Outlet</strong></a> designer labels <a href="ieia.in/...let.asp"><strong>Burberry Outlet Online</strong></a> designer labels <a href="ieia.in/...let.asp"><strong>Burberry Outlet Store</strong></a> designer labels <a href="www.cnbchotels.com/burberryoutlet.asp"><strong>Burberry Outlet</strong></a> designer labels <a href="www.cnbchotels.com/burberryoutlet.asp"><strong>Burberry Outlet Online</strong></a> designer labels <a href="www.cnbchotels.com/burberryoutlet.asp"><strong>Burberry Outlet Store</strong></a> designer labels <a href="www.thekennygallery.ie/burberryoutlet.asp"><strong>Burberry Outlet</strong></a> designer labels <a href="www.thekennygallery.ie/burberryoutlet.asp"><strong>Burberry Outlet Online</strong></a> designer labels <a href="www.thekennygallery.ie/burberryoutlet.asp"><strong>Burberry Outlet Store</strong></a> designer labels <a href="www.fruitsbear.jp/.../tomsoutlet.html"><strong>Toms Outlet</strong></a> designer labels <a href="www.fruitsbear.jp/.../tomsoutlet.html"><strong>Cheap Toms</strong></a> designer labels <a href="www.fruitsbear.jp/.../tomsoutlet.html"><strong>Toms Shoes Outlet</strong></a> designer labels <a href="www.fruitsbear.jp/.../cheaptoms.html"><strong>Toms Outlet</strong></a> designer labels <a href="www.fruitsbear.jp/.../cheaptoms.html"><strong>Cheap Toms</strong></a> designer labels <a href="www.fruitsbear.jp/.../cheaptoms.html"><strong>Toms Shoes Outlet</strong></a> designer labels <a href="tvmax-9.com/poms.asp"><strong>Burberry Outlet</strong></a> designer labels <a href="tvmax-9.com/poms.asp"><strong>Burberry Outlet Online</strong></a> designer labels <a href="www.africabio.com/.../views.php"><strong>Burberry Outlet</strong></a> designer labels <a href="www.africabio.com/.../views.php"><strong>Burberry t shirt</strong></a> designer labels <a href="www.wovv.org/burberry-outlet.asp"><strong>Burberry Sale</strong></a> designer labels <a href="www.wovv.org/burberry-outlet.asp"><strong>Burberry Watches</strong></a> designer labels <a href="www.megabites.com.sg/sitemaps.html"><strong>Burberry Outlet</strong></a> designer labels <a href="www.megabites.com.sg/sitemaps.html"><strong>Burberry Outlet Store</strong></a> designer labels <a href="www.betterrugbycoaching.com/burberry-outlet.asp"><strong>Burberry Outlet</strong></a> designer labels <a href="www.betterrugbycoaching.com/burberry-outlet.asp"><strong>Burberry Outlet Online</strong></a> designer labels <a href="www.betterrugbycoaching.com/burberry-outlet.asp"><strong>Burberry Outlet Online store</strong></a> designer labels <a href="www.zhunmum.com/.../tomsoutlet.html"><strong>Toms Outlet</strong></a> designer labels <a href="www.zhunmum.com/.../tomsoutlet.html"><strong>Cheap Toms</strong></a> designer labels <a href="www.spindle.net/.../rss.asp"><strong>Toms Outlet</strong></a> designer labels <a href="www.spindle.net/.../rss.asp"><strong>Cheap Toms</strong></a> designer labels <a href="newshoesonlines.webs.com/"><strong>Toms Outlet</strong></a>

Thomasine Pittinger
Thomasine Pittinger United States
9/20/2013 8:04:18 AM #

Greetings from Florida! I'm bored to death at work so I decided to check out your blog on my iphone during lunch break. I love the knowledge you present here and can't wait to take a look when I get home. I'm shocked at how fast your blog loaded on my mobile .. I'm not even using WIFI, just 3G .. Anyhow, superb site!|

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

Advertizement 1
Advertizement 2
Advertizement 3
Advertizement 4
Advertizement 5