Click here to Skip to main content
Rate this: bad
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.
         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) {
Posted 6-Oct-11 1:34am
Edited 6-Oct-11 2:17am
Not Active10.2K

1 solution

Rate this: bad
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>");[^]
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)

Advertise | Privacy | Mobile
Web04 | 2.8.150326.1 | Last Updated 6 Oct 2011
Copyright © CodeProject, 1999-2015
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