Hi.  I'm an experienced C# developer but very new to (somewhat
advanced) JavaScript.

On the server, I have a method defined as:

[AjaxPro.AjaxMethod]
public NameValueCollection GetArtists()
{
    NameValueCollection nvc = new NameValueCollection(3);
    nvc.Add("Test1", "1");
    nvc.Add("Test2", "2");
    nvc.Add("Test3", "3");

    return nvc;
}

On the client, I my (async callback) function defined as:

function callback(res) {
alert(res.value.getValue("Test2"));
}

This works great!  It alerts "2", as expected.  So I know everything is
hooked up correctly.

My question is, in JavaScript, what exactly is "res"?  In terms of,
what type of object is this?  I want to be able to iterate over this,
such as:

for (var i=0; i < res.value.length; i++)

However, res.value.length is undefined.  Can anyone let me know how I
can iterate over this NameValueCollection on the clientside, in order
to do something useful with the returned values?

Thanks!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Ajax.NET Professional" group.

To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]

For more options, visit this group at http://groups.google.com/group/ajaxpro

The latest downloads of Ajax.NET Professional can be found at 
http://www.ajaxpro.info
-~----------~----~----~----~------~----~------~--~---

Reply via email to