【发布时间】:2010-07-04 22:50:08
【问题描述】:
看起来它只是不想工作......
@网络服务:
<ScriptMethod(UseHttpGet:=False, ResponseFormat:=ResponseFormat.Json), WebMethod()> _
Public Function LoginDB(ByVal user As String, ByVal pass As String) As String
global.user = user
global.pass = pass
If (<<lots of code to check if user is valid>>) Then
Return "1"
Else
Return "0"
End If
End Function
webservice 可以工作,如果用户有效,则返回 1,否则返回 0。但我总是以 XML 格式获取它
<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://tempuri.org/">"0"</string>
@Jquery:
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "Services/Autenticacao.asmx/LoginDB",
data: "{'user':'ale','pass':'123'}",
dataType: "json",
success: function(data) {
alert(data);
},
.....
有人吗?
【问题讨论】:
标签: asp.net jquery vb.net web-services