How to reset variables and rebuild DropDownList without using postback
<p>I've had this issue for very long now where I am trying to get a user input from a person via a DropDownList. It seems to work the first time(after a postback). But when I try to get the user to select a new value from the DropDownList, it seems to default back to my previously selected values. My question is how do I get the javascript code to reassign the variables to the currently newly selected values. If I do a postback it seems to work since it gets refreshed. However I don't want to do a postback everytime.</p>

<p>Here is my javascript code:</p>

<pre><code>function getCaseFiles(canMoveExpenses) {
        //create Popup with content from div
        $('#ddlFiles').dialog({
            autoOpen: true,
            height: 'auto',
            width: 'auto',
            modal: true,
            buttons: {
                "Ok": function () {
                    debugger;
                    var dropDownList = document.getElementById("ddlCaseFilesNew");
                    var newCaseDdl = dropDownList.options[dropDownList.selectedIndex].value;
                    //alert("newCaseDdl = " + newCaseDdl);

                    var oldCaseFile = $("#hidCaseFile").val();//&lt;asp:HiddenField id="hidCaseFile"&gt;
                    //alert(oldCaseFile);

                    if (newCaseDdl != -1) {
                        moveCasefile(canMoveExpenses, newCaseDdl, oldCaseFile);
                        $(this).dialog('close');
                        $("#viewExpensesGrid").flexReload();
                    }
                    else {
                        showMessage("Error. Please Select a Value From The Lists.");
                    }
                },
                Cancel: function () {
                    $(this).dialog('close');
                    $("#viewExpensesGrid").flexReload();
                }
            }
        });
    }
</code></pre>

<p>and here is my DropDownList div:</p>

<pre><code>&lt;div id="ddlFiles"&gt;
    &lt;label&gt;
        Select new CaseFile:&lt;/label&gt;
    &lt;asp:DropDownList runat="server" ID="ddlCaseFilesNew" DataSourceID="dsCaseFiles"
        DataTextField="Display" DataValueField="FileID" 
        OnPreRender="ddl_PreRender" Width="300px"/&gt;
&lt;/div&gt;
</code></pre>

<p>My function calls this div and places it inside a custom popup.</p>

<p>Seems my variables containing the selectedIndex isn't being updates if it is not a postback.</p>
