Move Options Up / Down List-box JavaScript / ASP 
<p>Hi I'm trying to learn javascript and I'm messing around with this <a href="http://www.mattkruse.com/javascript/selectbox/source.html" rel="nofollow">example</a> I found:</p>

<pre><code>            function moveOptionUp(obj) {
            if (!hasOptions(obj)) { return; }
            for (i = 0; i &lt; obj.options.length; i++) {
                if (obj.options[i].selected) {
                    if (i != 0 &amp;&amp; !obj.options[i - 1].selected) {
                        swapOptions(obj, i, i - 1);
                        obj.options[i - 1].selected = true;
                    }
                }
            }
        }
</code></pre>

<p>I have a list box </p>

<pre><code>                &lt;input type="button" value="Up" onclick="moveOptionUp(this.form['_lb2'])" /&gt;

                &lt;asp:ListBox ID="_lb2" name="_lb2" runat="server" Height="400px" Width="170px"&gt;
                &lt;/asp:ListBox&gt;
</code></pre>

<p>However I can't get it to work ... The example uses a html select box.  I think the problem is with passing in the control as a parameter.  What is the correct way to do this using asp controls.  </p>

<p>Ohh BTW .. List box items are added dynamically </p>
