title: How to change datasource of dropdown in jquery
body: <p>I am looking to change to list items available in a dropdownlist via jquery (using razor in MVC3).</p>
  
  <p>I have a DDL that is populated from view data;</p>
  
  <pre><code>@Html.DropDownList("allusers", null, null, new { @class = "chosenlist" })
  </code></pre>
  
  <p>There is also another set of viewdata called "allNewUsers". I have a button that is clicked that runs a bit of clientside jquery:</p>
  
  <pre><code>   $(function() {
      $('#remove').click(function () {
          var id = $("#allusers").val();
          var hdr = $("#Holdersid").val();
          $.ajax({
              url: "RemoveApprover/" + id + "/" + hdr + "/3",
              data: id,
              success: function (data) {
                  $('#remove').hide();
                 $..change view data here
              },
              error: function (xhr, ajaxOptions, thrownError) {  
                  alert(xhr.responseText);
              }
          })
      })
      });
  </code></pre>
  
  <p>This code runs a public string back on the server and on success hides the remove button. What I then need to do is change the datasource of the DDL from allusers to allNewusers. can I do this easily in my client side code?</p>
  
  <p>many thanks</p>