我有一个像这样的ajax函数:
$.ajax({
type: "POST",
url: 'AjaxControls.aspx/CreateUserLevel',
data: { LevelNameAddLevel: $('#LevelNameAddLevel').val() },
dataType: "json",
success: function (response)
{
console.log(response);
if (response == "true")
{
$("#ErrorDivAddLevel").html('Level created successfully!').fadeIn('slow');
}
else
{
$("#SuccessDivAddLevel").html('Level creation failed!').fadeIn('slow');
}
}
});
问题是响应返回了一个空值。
网络方法是:
<WebMethod(EnableSession:=False)>
Public Shared Function CreateUserLevel() As String
Return "true"
End Function