returning List<string> from JSON call in Jquery has undefined length
<p>I am making a call to a webservice from jquery and trying to return an List (I have also tried a string[]). When I get the results back I can see it holds an array with the  values I need, but I can not iterate through them in Javascript because there is no length value.</p>

<p>my C# Webservice is as follows:</p>

<pre><code>    [WebMethod]
    public string[] GetMultiChoiceOptions(int keyId)
    {
        string connectionString = System.Web.Configuration.WebConfigurationManager.ConnectionStrings["OBConnectionString"].ConnectionString;
        SitesUtil db = new SitesUtil(connectionString);
        List&lt;MultiChoiceOption&gt; keys = db.GetMultiChoiceOptions(keyId, 1); //TO DO CHANGE THIS TO REAL USERID

        return keys.Select(a =&gt; a.OptionValue).ToArray();
    }
</code></pre>

<p>and My Jquery/javscript call is as follows:</p>

<pre><code>function GetKeys(keyid) {

    var pageUrl = '&lt;%=ResolveUrl("~/WebService/UpdateDatabase.asmx")%&gt;'
    $.ajax({
        type: "POST",
        url: pageUrl + "/GetMultiChoiceOptions",
        data: '{keyId:' + keyid + '}',
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: GetKeysSuccessCall,
        error: OnErrorCall
    });
}

function GetKeysSuccessCall(response) {
    /* TO DO */
    var i = 0;
    for (i =0; i &lt; response.length; i++) {
        $("#popupList").append('&lt;li&gt;' + response[i] + '&lt;/li&gt;');                
        }       
}
</code></pre>

<p>I'm not sure how I deal with an array without a length in javascript?</p>
