Forums - C# Corner

Forum guidelines
Debopriyo Dey

Debopriyo Dey

  • 1.6k
  • 51
  • 3.2k

bind checkbos from database using jquery.

Sep 14 2017 1:58 AM
I have a checkboxlist as follows
<div class="form-group" id="chkbxSpeciality">
<p class="help-block" id="lblSpecialityErr" style="color: Red;">
and this is the js to bind data from database.
function BindSpecialityType() {
type: "POST",
url: "MRRegistration.aspx/GetSpeciality",
data: {},
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
var objdata = $.parseJSON(response.d);
BindSpecialityCheckBoxList('chkbxSpeciality', objdata);
function BindSpecialityCheckBoxList(target, data) {
var table = $('<table></table>');
var counter = 0;
$(data).each(function () {
type: 'checkbox', name: 'chklistitem', value: this.SPECIALITYID , id: target + counter
for: 'chklistitem' + counter++
}).text(this.SPECIALITYNAME ))));
but i am not able to bind. Please help 

Answers (2)


Build smarter apps with Machine Learning, Bots, Cognitive Services - Start free.

Start Learning Now