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");
}
});
});
});
$('#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");
}
});
});
});

Chandu KumawatRank #1,449 · 1.1K reputationPosted Feb 23, 2016, 9:13 PM EST
chiranjit das112 reputationPosted Feb 23, 2016, 9:19 PM EST
Chandu KumawatRank #1,449 · 1.1K reputationPosted Feb 23, 2016, 9:30 PM EST
Amit Kumar SinghRank #562 · 4.3K reputationPosted Feb 23, 2016, 9:33 PM EST
chiranjit das112 reputationPosted Feb 23, 2016, 9:37 PM EST
Rajeesh MenothRank #118 · 18.4K reputationPosted Feb 23, 2016, 9:45 PM EST
chiranjit das112 reputationPosted Feb 23, 2016, 10:35 PM EST