Handling a ArrayList or List type of C# in jquery
<p>I want to bind the HTML select element with the database.</p>

<p>I want to bind the text and value of select element</p>

<p>The problem is dont want to return the string array with text and value of each option combined using some symbol rather i want to return an array list or some List</p>

<p>Now after returning using PageMEthods i cannot iterate over the result to get the id and value of select options.</p>

<p>I cannot use JSON i have to use PageMethods only.</p>

<pre><code>ArrayList obj = new ArrayList();

var countries = EntityService.ServiceInstance.GetCountries();

foreach (var country in countries)
{
    ListItemClass temp = new ListItemClass();

    temp.ListItemText = country.country_name.ToString();
    temp.ListItemValue = country.id.ToString();

    obj.Add(temp);
}

return obj;
</code></pre>

<p>What I want is how can I get the ID and country name in jQuery</p>

<p>Any help is appreciated.</p>

<p>Thanks</p>

<p>PROBLEM SOLVED:</p>

<p>I need to write :</p>

<p>where <strong>test</strong> is the return type of method </p>

<pre><code>$.each(test,
    function (intIndex, objValue) {
        $.each(objValue, function (intIndex1, objValue1) {
            alert(objValue1);
        })
    }
);
</code></pre>

<p>But dont know whether this is a correct approach or not.</p>
