7
Answers

Dropdownlist Value not Save in Database

chiranjit das

chiranjit das

8y
431
1
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)