Could you please check and let me know what is the problem in the below code. I have the valid value in the response.d (I checked my adding alert), but when I assign that value to label it is not changing the value in label(lblData).
function LoadPlanBoard() {
$.ajax({
type: "POST",
url: "myplanboard.aspx/WebLoadPlanBoard",
data: "{flag:'" + 0 + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
$('#<%=lblData.ClientID %>').val(response.d);
},
failure: function (response) {
alert(response);
},
error: function (jqXHR, textStatus, errorThrown) {
var errMessage = "An error occured serving your request. Please try again.";
if (jqXHR)
errMessage = $.parseJSON(jqXHR.responseText).Message;
alert(errMessage);
}
});
}
Labels in ASP.NET are rendered as span tags I think. I’d try using
.html(htmlString).