title: Move data from one listbox to another on button click in asp.net mvc
body: <p>i am new in ASP.net MVC.
  I have two listbox one listbox contain data from db and wanted to move data into another listbox and save into database.. i have done the following code to display the two listbox..
  <strong>InstituteInformation.cs</strong></p>
  
  <pre><code>public class InstituteInformation
      {
           public int Id { get; set; }
          public string InstituteName { get; set; }
      }
  </code></pre>
  
  <p>Fetch the name of institute name into listbox1</p>
  
  <p><strong>MemberAccessRights.cs</strong></p>
  
  <pre><code> public class MemberAccessRights
   {
      public int Id { get; set; }
  
      public List&lt;InstituteInformation&gt; AvailableNames { get; set; }
      public int[] AvailableSelected { get; set; }
  
      public List&lt;InstituteInformation&gt; RequestedNames { get; set; }
      public string[] RequestedSelected { get; set; }
  
      public string SavedRequested { get; set; }
  }
  </code></pre>
  
  <p><strong>Wrapper.cs</strong></p>
  
  <pre><code> public class Wrapper
  {
      public InstituteInformation II { get; set; }
  }
  </code></pre>
  
  <p><strong>Wrapper1.cs</strong></p>
  
  <pre><code>public class Wrapper1
  {
      public MemberAccessRights MAR { get; set; }
  }
  </code></pre>
  
  <p><strong>WrapperDB.cs</strong></p>
  
  <pre><code>public class WrapperDB : DbContext
  {
    public DbSet&lt;InstituteInformation&gt; IIDBS { get; set; }
    public DbSet&lt;MemberAccessRights&gt; MARDBS { get; set; }
  }
  </code></pre>
  
  <p><strong>In controller</strong></p>
  
  <pre><code>    [NonAction]
      public List&lt;InstituteInformation&gt; getAllInstituteNameList()
      {
          var name=(from i in db.IIDBS select i).ToList();
          return name;
      }
  
  
      //
      // GET: /MemberDetails/Create
  
      public ActionResult Create()
      {
          Wrapper1 MD = new Wrapper1();
          MD.MAR = new MemberAccessRights { AvailableNames = getAllInstituteNameList(), RequestedNames = new List&lt;InstituteInformation&gt;() };
          return View(MD);
      }
  </code></pre>
  
  <p><strong>View</strong></p>
  
  <pre><code>     List of Financial Institute
  
       &lt;%:Html.ListBoxFor(model=&gt;model.MAR.AvailableSelected,new MultiSelectList(Model.MAR.AvailableNames,"Id","InstituteName",Model.MAR.AvailableSelected)) %&gt;
  
       &lt;div&gt;
  
       &lt;input id="add" name="add" type="submit" value="&gt;&gt;" /&gt;
       &lt;br /&gt;
       &lt;input id="remove" name="remove" type="submit" value="&lt;&lt;" /&gt;
  
       &lt;/div&gt;
  
  
      &lt;%:Html.ListBoxFor(m=&gt;m.MAR.RequestedSelected,new MultiSelectList(Model.MAR.RequestedNames,"Id","Name",Model.MAR.RequestedSelected)) %&gt;
  </code></pre>
  
  <p>now i wanted to move data from listbox1 to listbox2
  and i dont have any idea how to do this
  can anyone sugesst me about this ...</p>