title: Jquery Multiselect plugin using in asp.net listbox and events
body: <p>I want to use <a href="http://loudev.com/" rel="nofollow">http://loudev.com/</a> this plugin for listboxes which comes with theme.
  html codes</p>
  
  <pre><code>                            &lt;div class="span2"&gt;
  
                                  &lt;div class="control-group"&gt;
                                      &lt;label class="control-label"&gt;&lt;/label&gt;
                                      &lt;div class="controls"&gt;
                                          &lt;asp:ListBox runat="server" ID="listboxAdd" SelectionMode="Multiple" Rows="10" /&gt;
                                          &lt;span class="help-inline text-center"&gt;Group List&lt;/span&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
  
                              &lt;/div&gt;
  
                              &lt;div class="span1"&gt;
                                  &lt;br /&gt;
                                  &amp;nbsp;&lt;br /&gt;
                                  &lt;div class="control-group"&gt;
                                      &lt;label class="control-label"&gt;&lt;/label&gt;
                                      &lt;div class="controls"&gt;
                                          &lt;asp:LinkButton runat="server" ID="btnRemove" CssClass="btn red block" OnClick="btnRemove_Click"&gt;&amp;nbsp;&amp;nbsp;&lt;i class="m-icon-swapleft m-icon-white"&gt;&lt;/i&gt;&amp;nbsp;&amp;nbsp;&lt;/asp:LinkButton&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                                  &lt;br /&gt;
                                  &lt;div class="control-group"&gt;
                                      &lt;label class="control-label"&gt;&lt;/label&gt;
                                      &lt;div class="controls"&gt;
                                          &lt;asp:LinkButton runat="server" ID="btnAdd" CssClass="btn green block" OnClick="btnAdd_Click"&gt;&amp;nbsp;&amp;nbsp;&lt;i class="m-icon-swapright m-icon-white"&gt;&lt;/i&gt;&amp;nbsp;&amp;nbsp;&lt;/asp:LinkButton&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
  
                              &lt;/div&gt;
  
                              &lt;div class="span2"&gt;
  
                                  &lt;div class="control-group"&gt;
                                      &lt;label class="control-label"&gt;&lt;/label&gt;
                                      &lt;div class="controls"&gt;
                                          &lt;asp:ListBox runat="server" ID="listboxAdded" SelectionMode="Multiple" Rows="10" /&gt;
                                          &lt;span class="help-inline text-center"&gt;Added Groups&lt;/span&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
  
                              &lt;/div&gt;
  </code></pre>
  
  <p>c# code</p>
  
  <pre><code>//for group list
      private void Group_Load()
      {
          listboxAdd.Items.Clear();
  
          DataTable dt = new DataTable();
          dt = myTracking.Master_Group_Load(Int32.Parse(Company.Value)).Tables[0];
  
          if (dt.Rows.Count &gt; 0)
          {
              listboxAdd.DataTextField = "Group_Name";
              listboxAdd.DataValueField = "Group_ID";
              listboxAdd.DataSource = dt;
              listboxAdd.DataBind();
  
          }
      }
  
        //for added group
  
      private void Added_Group_Load()
      {
          listboxAdded.Items.Clear();
          DataTable dt = new DataTable(); ;
          dt = myTracking.Object_Group_Load(Int32.Parse(hd_objectID.Value)).Tables[0];
  
          if (dt.Rows.Count &gt; 0)
          {
              listboxAdded.DataTextField = "Group_Name";
              listboxAdded.DataValueField = "Object_Group_ID";
              listboxAdded.DataSource = dt;
              listboxAdded.DataBind();
  
          }
      }
  
  
  
       // add to right side (insert table) [added group]
      private void Group_Insert()
      {
  
          try
          {
              myTracking.Object_Group_Insert(Int32.Parse(listboxAdd.SelectedValue), Int32.Parse(hd_objectID.Value), Session["IPADDRESS"].ToString(), Session["GetMACAddress"].ToString(), Int32.Parse(Company.Value), Int32.Parse(Session["Child_Company_ID"].ToString()));
              Added_Group_Load();
              Call_Alert("alert-success");
          }
          catch (Exception)
          {
  
              Call_Alert("alert-error");
          }
  
      }
  
  
       //remove from right side [added group]
      private void Group_Remove()
      {
          try
          {
              myTracking.Object_Group_Delete(Int32.Parse(listboxAdded.SelectedValue));
              Added_Group_Load();
              Call_Alert("alert-success", "&lt;i class=" + "icon-ok" + "&gt;&lt;/i&gt; &lt;strong&gt; Gruptan Çıkarıldı!..&lt;/strong&gt;");
          }
          catch (Exception)
          {
              Call_Alert("");
          }
      }
  
      protected void btnAdd_Click(object sender, EventArgs e)
      {
          int groupId, objectID;
          if (TryParsing(listboxAdd.SelectedValue, out groupId) &amp;&amp; TryParsing(listboxAdd.SelectedValue, out objectID))
          {
              Group_Insert();
          }
          else
          {
              Call_Alert("");
          }
      }
  
      protected void btnRemove_Click(object sender, EventArgs e)
      {
          int ObjectID;
          if (TryParsing(listboxAdded.SelectedValue, out ObjectID))
          {
              Group_Remove();
          }
          else
          {
              Call_Alert("");
          }
      }
  </code></pre>
  
  <p>This works fine for asp.net elemwnts and logic but I want to adapt it jquery multiselect.js</p>
  
  <pre><code>var handleMultiSelect = function () {
          $('#ContentPlaceHolder1_listboxAdd').multiSelect();
          }
  </code></pre>
  
  <p>If use this it hides first one [group list] and create two listbox first one has group list and second one is empty.  If I click an item its added second one by js.</p>
  
  <p>I want it full works iwth this plugin if I click first one it triggers <code>Group_Insert()</code> and when I click it called <code>Group_remove()</code> like buttons click event. how is it possible?</p>