Getting the value of a DropDownList after client side javascript modification
<p>I have a cascading DropDownList in an application.  The contents of the cascading drop down list is small enough that there isn't a need to use AJAX/JSON to go to a database to get the content, I am just doing it in client side javascript like this (this is a subset of the data):</p>

<pre>
<code>
var val = typeList.value; 
var applyTimeList = document.getElementById('clientid');
for (var q=applyTimeList.options.length; q>=0; q--) 
    applyTimeList.options[q]=null;

if (val == 'AutoRoute')
{
    myEle = document.createElement('option') ;
    myEle.value = 'SOP Processed';
    myEle.text = 'SOP Processed';
    applyTimeList.add(myEle) ;
} else if (val == 'Tier1Retention') {
    myEle = document.createElement('option') ;
    myEle.value = 'Study Processed';
    myEle.text = 'Study Processed';
    applyTimeList.add(myEle);
    myEle = document.createElement('option') ;
    myEle.value = 'Study Restored';
    myEle.text = 'Study Restored';
    applyTimeList.add(myEle);
    myEle = document.createElement('option') ;
    myEle.value = 'Study Archived';
    myEle.text = 'Study Archived';
    applyTimeList.add(myEle) ;
}
</code>
</pre>

<p>When I attempt to access the DropDownList on the client side I can't get the value selected, it always returns 0 as the index:</p>

<pre>
<code>
int index = RuleApplyTimeDropDownList.SelectedIndex;
</code>
</pre>

<p>How can I get the value selected on the Server side after modification?</p>

<p>Note:  I already know the answer to this, I just want the question/answer posted on SO.</p>
