How to store the value of the listbox value?
<p>the page is post backing every time when i click the button(btnadd).could any one tell me how to store the selected  value of the listbox.Here am adding from one listbox to another listbox.</p>

<pre><code> &lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="ListBoxExample.aspx.cs" Inherits="ListBoxExample"
    EnableEventValidation="false" %&gt;

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head runat="server"&gt;
    &lt;title&gt;Adding,removing elements from First Listbox to Second Listbox&lt;/title&gt;
    &lt;style type="text/css"&gt;
        .lstbx1
        {
            font-family: Verdana;
            font-size: medium;
            font-style: normal;
            background-color: Aqua;
            height: auto;
            width: auto;
        }
        .lstbx2
        {
            font-family: Verdana;
            font-size: medium;
            font-style: normal;
            background-color: Lime;
            height: auto;
            width: auto;
        }
    &lt;/style&gt;
    &lt;script type="text/javascript" src="http://code.jquery.com/jquery-1.4.1.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript"&gt;
         jQuery(document).ready(function () {
            $('#btnadd').click(function () {
               // var originalList = $("#&lt;%= this.lstbx1.ClientID %&gt;");
                var items = $('option', originalList);
                var targetList = $("#&lt;%= this.lstbx2.ClientID %&gt;");
                $("#lstbx1 option:selected").remove().appendTo("#lstbx2");
            });
        });


    &lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;form id="form1" runat="server"&gt;
    &lt;div&gt;
        &lt;table&gt;
            &lt;tr&gt;
                &lt;td&gt;
                    &lt;asp:ListBox ID="lstbx1" runat="server" CssClass="lstbx1" SelectionMode="Multiple"&gt;
                        &lt;asp:ListItem&gt;John&lt;/asp:ListItem&gt;
                        &lt;asp:ListItem&gt;Peter&lt;/asp:ListItem&gt;
                        &lt;asp:ListItem&gt;Sam&lt;/asp:ListItem&gt;

                    &lt;/asp:ListBox&gt;
                &lt;/td&gt;
                &lt;td&gt;
                    &lt;asp:ListBox ID="lstbx2" runat="server" CssClass="lstbx2"&gt;&lt;/asp:ListBox&gt;
                &lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;td&gt;
                    &lt;input type="button" id="btnadd" value="Add" /&gt;
                &lt;/td&gt;
                &lt;td&gt;
                    &lt;asp:Button ID="btnremove" runat="server" Text="Remove" /&gt;
                &lt;/td&gt;
            &lt;/tr&gt;
        &lt;/table&gt;
    &lt;/div&gt;
    &lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
