我已将 Charisma V.2.0.0 捆绑包集成到 ASP.Net C# 应用程序中。在我编写对 Web 服务的 .ajax 调用之前,一切看起来都很好。Ajax 调用是一种标准格式,可在基本的 asp.net 页面中工作,但来自捆绑包。他的“bower_components”中似乎有一些东西。我删除了对 bower_components/jquery 的引用,并且包括 ajax.googleapis.com... 3.3.1。
有没有人有这个问题的经验?什么可能是解决方案?我喜欢 Muhammad 设计的 UI,并希望继续开发平台。
axax 调用如下所示:
// Edit Client button
$(document).on("click", "[id*=btnEditClient]", function () {
// Edit selected client/Event Id - get data from Ajax
//alert($(this).val());
var clientId = $(this).val();
var clientInfo = JSON.stringify({ clientId: clientId });
alert(clientInfo);
$.ajax(
{
url: '<%= ResolveUrl("QRWebService.aspx/GetClientListService") %>',
type: "POST",
data: clientInfo,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (result) {
// results
alert(result.d);
alert('no error ' + JSON.stringify(result));
$("#myModal").modal()
return true;
},
error: function (jqXHR, textStatus, errorThrown) {
alert('error: ' + textStatus);
}
});
return false;
})
结果是“未定义”,Web 服务永远不会被调用。
网络服务是:
[WebMethod]
public static DataSet GetClientListService()
{
// returns dataset LIST of Client Id and Name
DataSet ds = new DataSet();
SQLHelper.SqlQuery oQuery = new SQLHelper.SqlQuery();
String strSQL;
try
{
strSQL = "SELECT Clients.ClientId, ClientName FROM Clients ";
strSQL += "WHERE ClientActive=@clientActive";
ds = oQuery.GetDataSet(strSQL);
} catch(Exception ex){
errorMessage = ex.Message;
}
return ds;
} // end GetClientEventList()