I have a RadDatePicker, where on selection of a date, the date is saved in the DB and the user should get a message that date is saved. The RadDatePicker calls a function on its event OnDateSelected as follows(C#):
The javascript function SaveDate successfully calls a webservice to save the date selected.
The above successfully saves the value and alerts a message. Instead of an alert I want to display a text message near this RadDatePicker control which says "Saved" and disappears in a few seconds.
For this I added a label and made it invisible as follows:
radDatePicker.ClientEvents.OnDateSelected = "function(sender, args){SaveDate(sender,args," + PriceDealProposalId + ")}";
The javascript function SaveDate successfully calls a webservice to save the date selected.
function SaveDate(sender, e, id) {
if (e.get_newDate() != null) {
$.ajax({
url: "/ajaxservice.asmx/SaveSignedDate",
data: "{priceDealProposalId:" + id + ",proposalDate: " + JSON.stringify(e.get_newDate()) + "}",
dataType: "json",
type: "POST",
contentType: "application/json;charset=utf-8",
success: function (data) {
alert("saved");
}
});
}
}
For this I added a label and made it invisible as follows:
savedLabel.Attributes.Add("style", "display:none;");
How can I access this label in the success part of the ajax call. On success I want to make the label visible so that user knows the date as saved.