chiranjit das

chiranjit das

  • NA
  • 112
  • 31.6k

Dropdownlist Value not Save in Database

Feb 26 2016 2:49 AM
Dear Sir 
I have create a project the dropdown list have not save
in database
 
<script src="Js/jquery-1.10.2.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#btnSave').click(function () {
var name = $('#txtDesignationName').val();
var code = $('#txtCode').val();
var grade = $('#ddlGrade').find(":selected").val();
var Division = $('#ddlDivision').text();
var Department = $('#ddlSelectDepartment option:selected').text();
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");
}
});

});
});
</script>

Answers (2)