Click here to Skip to main content
12,079,202 members (47,015 online)
Rate this:
 
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
Not Active10.2K
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 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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160212.1 | Last Updated 6 Oct 2011
Copyright © CodeProject, 1999-2016
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