i have a csharp method which is updating the database and it should be called in javascript function .
this is code behind
public void storeprogress()
{
con.Open();
cmd.CommandText = "update mytable set Progress='" + progress + "' where [Registered]='" +DropDownList1.SelectedValue.ToString() + "'and [EmployeID]='" + Label1.Text.ToString() + "' ";
cmd.Connection = con;
cmd.ExecuteNonQuery();
con.Close();
}
and js
function InsertProgress() {
$.ajax({
type: "POST",
url: 'NewVideosPage.aspx/storeprogress',
data: "",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
alert("I am working ");
},
error: function (e) {
alert("Something Wrong.");
}
});
}
Raj maddalaPosted Mar 21, 2018, 4:28 AM
Avnish KumarPosted Mar 5, 2018, 6:20 AM
Rajneesh ChaubeyPosted Mar 5, 2018, 4:48 AM