I'm working on an MVC2 site that needs to update the values of a select list based on the value selected by a user in another list. This is the response I'm getting from my controller's JSON action:
[{"Selected":false,"Text":"Client1Group1","Value":null},{"Selected":false,"Text":"Client1Group2","Value":null}]
The problem is that the data object my function gets back is a collection of generic objects. When the following script runs I get two alerts, but instead of getting the Text value from my objects I get "undefined".var clients = $("#properties_ClientList");var groups = document.getElementById("properties_GroupList");//User selects a client nameclients.change(function() { //Clear group SelectList $('#properties_GroupList option').each(function(i, option){ $(option).remove(); }); //Repopulate group SelectList $.getJSON("<%=Url.Content("~/Admin/GetGroupSelectListForReportEditViewAsJsonResult")%>", { clientId: clients.val() }, function(data) { $.each(data, function(){
View Complete Post