大家好,
我用ajax回传的问题。它工作得很好,但不是在ASP.NET 4 2.0。
这是我的代码:
$("#<%=registrationNumberTextBox.ClientID%>").blur(function() {
if ($(this).val().length > 0) {
$.ajax({
type: "POST",
url: "registration.aspx/GetAmountDue",
data: "{'registrationNumber': '" + $(this).val() + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
success: function(msg) {
$("#<%=amountDueLiteral.ClientID%>").val(msg.d);
},
error: function(x, e) {
alert("The call to the server side failed. " + x.responseText);
}
});
} else { $("#<%=amountDueLiteral.ClientID%>").html('0.00'); }
});
{C} 的问题是,一些返回的结果,但不上amountDueLiteral显示。我该怎么办?