title: Value of dropdownlist in asp.net disappears after changing the value of dropdownlist by javascript
body: <p>In my application, I have created an ajax autocompelete extender text box.Once the user chooses the value, I want to insert that value in my dropdownlist.
  The code for that purpose is:</p>
  
  <pre><code>function GetCode(source, eventArgs) {
           var hfield = $get('&lt;%=this.HiddenID.ClientID%&gt;');
           hfield.value = eventArgs.get_value();
  
         //hfield has the value selected in the autocomplete text box
  
          var abc = document.getElementById('&lt;% =DropDownList2.ClientID %&gt;');
  
           for (var i = 0; i &lt; abc.length ; i++) {
               alert(abc.options[i].value);
               if (abc.options[i].value == hfield.value) {
                   abc.options[i].selected = true;
                   break;
               }
           }
       }
  </code></pre>
  
  <p>The problem here is: My value is not showing in the dropdownlist.
  When I tried to debug the code, I realized that the value does come in the dropdownlist but when this code exits, the value disappears from the dropdownlist.</p>
  
  <p>I have no idea why the values are disappearing! Please help! Thank you!</p>