title: Value set using JavaScript is not persisted on Postback
body: <p>I have two list controls in my asp.net page and am populating the second list control using javascript. Problem is the script executes and i can see the value moved from first list box (ConfiguredOrgListBox) to second list box(SelectedOrgListBox) but when i try to save using submit button i find my second list as empty and first list box as it was earlier. Below is the script and mark up.</p>
  
  <pre><code>    //call this method to register the script    
      private void CreateMoveOrganizationScript(StringBuilder sb) {
          sb.Append( @"&lt;script language=javascript type=text/javascript&gt;;
                      function moveOrganisation() {");            
          sb.Append( @"var source = document.getElementById('"+ ConfiguredOrgListBox.ClientID  +@"');
                      var target = document.getElementById('"+SelectedOrgListBox.ClientID+ @"');
                      if ((source != null) &amp;&amp; (target != null)) {
                      var newOption = new Option();
                      newOption.text = source.options[source.options.selectedIndex].text;
                      newOption.value = source.options[source.options.selectedIndex].value;
  
                      target.options[target.length] = newOption;
                      source.remove(source.options.selectedIndex)  ;
                      }            
                  } &lt;/script&gt;");            
      }
  </code></pre>
  
  <p>Markup</p>
  
  <pre><code>      &lt;asp:Label ID="ConfiguredOrgLabel" runat="server" Text="Available Organizations"&gt;&lt;/asp:Label&gt;&lt;br /&gt;
        &lt;asp:ListBox ID="ConfiguredOrgListBox" runat="server" Width="98%" Height="100px"&gt;&lt;/asp:ListBox&gt;
         &lt;input id="MoveOrgRight" type="button" value="&gt;&gt;" onclick="moveOrganisation()" /&gt;
        &lt;asp:Label ID="SelectedOrgLabel" runat="server" Text="Selected VNA Organizations"&gt;&lt;/asp:Label&gt;&lt;br /&gt;
        &lt;asp:ListBox ID="SelectedOrgListBox" runat="server" Width="98%" Height="100px"&gt;&lt;/asp:ListBox&gt;
  </code></pre>
  
  <p>Please let me know what I am doing wrong</p>
  
  <p>Regards,
  JeeZ</p>