Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
Hi...anyone can help on how to Bind the radio button list via Javascript or JQuery?
Data is array list return from Json and webservice.
 
$.ajax(
        {
         type: "POST",
         url: "../../Webservice/Control.asmx/getIdea",
         data: "{'D':'" + HP + "'}",
         contentType: "application/json",
         dataType: "json",
         success: function (data) {
         for (var i = 0; i < data.d.length; i++) {
           AddListItems(rblIdea, data.d[i].MGrpT, data.d[i].MGrpV);    
        }
         },
               failure: function (response) {
                   alert(response.d);
               }
           });
Posted 6-Oct-11 1:34am
Edited 6-Oct-11 2:17am
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

ASP.NET 4.0 has the ability to do client-side data binding Data Binding in ASP.NET AJAX 4.0[^]
 
If you are not using 4.0, then it is simply a matter of iterating through your array and appending html elements to the container
 
$("#mySelect").append("<option>" + some value + "</option>");
 
http://jquery.com/[^]
  Permalink  
Comments
cindy_03 at 7-Oct-11 22:12pm
   
Thanks for your answer..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Marcin Kozub 330
1 OriginalGriff 256
2 Sergey Alexandrovich Kryukov 215
3 Praneet Nadkar 197
4 Richard MacCutchan 182
0 OriginalGriff 8,048
1 Sergey Alexandrovich Kryukov 7,287
2 DamithSL 5,614
3 Manas Bhardwaj 4,986
4 Maciej Los 4,910


Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 6 Oct 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100