Dropdownlist text change while hidden aspx
<p>I have a drop down list with autopostback enabled.  When I change the value it updates a grideview on my webpage.  However I want to get rid of the drop down and use a textbox sort of like a search function.  I still want to keep my list though so I can compare my search string to the actual present values.  However, if I make my dropdown list invisible I cant compare values to the items in it.</p>

<p>Or is there a better solution?  A control that the user can't see but that I can put database values in it and compare those values with textbox text?</p>

<p>thanks for the help.</p>

<p>I am getting an error with this code:</p>

<pre><code>    foreach (string s in DropDownList3.Items)
    { 
       //foreach gives me the error below     

       if(s == idsearch.Text)
       {
          valid = true;    
          break;
       }
    }

    if(valid == true)
    {
       GridView1.DataBind();
    }
</code></pre>
