chiranjit das

chiranjit das

  • 1.5k
  • 112
  • 29.8k

Dropdownlist Value not Save in Database

Feb 24 2016 2:05 AM
Sir,
 
I was create a webpage the dropdown list value are save in database is undefined
i have attach my code
$(document).ready(function () {
$('#btnSave').click(function () {
var name = $("#txtDesignationName").val();
var code = $("#txtCode").val();
var grade = $("#ddlGrade").val();
var Division = $("#ddlDivision").val();
var Department = $("#ddlSelectDepartment").val();
var Heads = $("#txtHeads").val();
$.ajax({
type: 'POST',
contentType: "application/json; charset=utf-8",
url: 'Designation.aspx/Insert_Data',
data: "{'name':'" + name + "','code':'" + code + "','grade':'" + grade + "','Division':'" + Division + "','Department':'" + Department + "','Heads':'" + Heads + "'}",
async: false,
success: function (response) {
$("#txtDesignationNam").val("");
$("#txtCode").val("");
$("#ddlGrade").val("");
$("#ddlDivision").val("");
$("#ddlSelectDepartment").val("");
$("#txtHeads").val("");
alert("Record saved successfully..!!");
},
error: function () {

alert("Error");
}
});

});
}); 
 

Answers (7)