Asp.Net: keyboard sort items

sort_image

As proof of concept I wanted to sort images in a Grid by keyboard. The sort logic needed to be implemented on the server. My solution for this problem is a combination of Javascript and C#. First add following html to you .aspx. Notice that the body tag has runat=”server” and a ID. <body<strong> runat="server" ID="bodyTag"</strong>> <form id="form1" runat="server"> <asp:Button runat="server" Text="Up" ID="UpButton" CommandArgument="up" oncommand="DownButton_Command" /> <br /> <asp:Button runat="server" Text="Left" ID="LeftButton" CommandArgument="left" oncommand="DownButton_Command" /> <asp:Button runat="server" Text="Right" ID="RightButton" oncommand="DownButton_Command" CommandArgument="right" /> More Info »

The last few years I spend a lot of time working with Asp.Net AJAX. It all worked pretty good, the only downside is that you do not have control the generated HTML. With jQuery you can manipulate generated HTML. This HTML can be generated fully controlled with a ListView. I'm a lazy programmer so the first thing I needed to do is fix jQuery Intellisense in VS2008. I found my information for doing this on Scott Gu's blog (jQuery Intellisense in Vs 2008). More Info »

I've search them all up for a 1000 times. Now I'm going to write them down as reference. This post will grow in the next few months. Remember do not forget to set the behaviorId of the control.  References: CollapsiblePanelExtender Expand: $find('BehaviorId')._doOpen(); Collapse: $find('BehaviorId')._doClose(); $find('BehaviorId').collapsePanel(); ModalPopupExtender Show popup: $find('BehaviorId').show(); Hide popup: $find('BehaviorId').hide();