After liberating, I decided to try out using WebService to execute the workflow.
My first question is I'd like to know if the labels contains data that is being populated from database, how does one save record at the jquery portion ?
Please refer to the below code as to what I meant by the jquery way :
function SaveRecord() {
//Get control's values
document.getElementById("<%=lblInitiator.ClientID%>").value; // is this the way to do it for labels already contain data populated from database
var dateIssued = $.trim($('#<%=lblSubmitDate.Text .ClientID %>').val()); // this is one that is without any data in the label and user has to fill in via a calender
var msg = "";
//check for validation
if (dateIssued == '') {
msg += "<li>Please select date</li>";
}
if (msg.length == 0) {
//Jquery ajax call to server side method
$.ajax({
type: "POST",
dataType: "json",
contentType: "application/json; charset=utf-8",
//Url is the path of our web method (Page name/function name)
url: "ePMT.aspx/SaveEPMTRequest",
//Pass paramenters to the server side function
data: "{'dateIssued':'" + submitDate + "'}",
success: function (response) {
//Success or failure message e.g. Record saved or not saved successfully
if (response.d == true) {
//Set message
$('#dvResult').text("Record saved successfully");
//Reset controls
$('#lblInitiator').val('');
$('#lblSubmitDate').val('');
}
else {
$('#dvResult').text("Record could't be saved");
}
My second question is if I do not want to do it via the jquery way, is there any other way that I can do it.
If you are trying to save data back the server then you will need to set up a connection to communicate with it and provide server side functions that allow the server to update database tables.
Member
31 Points
251 Posts
How do I save record with labels that already have data populated ?
Jan 24, 2017 07:22 AM|tangara|LINK
Hi expert,
After liberating, I decided to try out using WebService to execute the workflow.
My first question is I'd like to know if the labels contains data that is being populated from database, how does one save record at the jquery portion ?
Do I do it like that ?
Please refer to the below code as to what I meant by the jquery way :
My second question is if I do not want to do it via the jquery way, is there any other way that I can do it.
Contributor
2155 Points
2142 Posts
Re: How do I save record with labels that already have data populated ?
Jan 25, 2017 09:52 PM|march11|LINK
If you are trying to save data back the server then you will need to set up a connection to communicate with it and provide server side functions that allow the server to update database tables.