我已经看过修复这个问题的多个例子,但我发现的所有决议似乎都没有用。我甚至创建了一个简单的页面来调用我的服务。我直接在浏览器中测试了该服务,它返回的数据很好。我已经在服务中设置了断点,看它是否被呼叫,而且它们似乎永远不会被击中。这是我简单的网页:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="demo.aspx.vb" Inherits="RasDelegates.demo" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<br />
<br />
<br />
<asp:TextBox ID="TextBox1" runat="server" AutoComplete="Off"></asp:TextBox>
<asp:AutoCompleteExtender ID="TextBox1_AutoCompleteExtender" runat="server"
DelimiterCharacters=""
MinimumPrefixLength="2"
CompletionSetCount="15"
CompletionInterval="10"
Enabled="True"
ServicePath="../WebServices/EmpWS.asmx"
TargetControlID="TextBox1"
ServiceMethod="FindEmployee"></asp:AutoCompleteExtender>
</form>
</body>
</html>
我简单的WebService
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.ComponentModel
Imports System.Collections.Generic
Imports System.Web.Script.Serialization
Imports System.String
<WebService(Namespace:="http://ws_EA01")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
<System.Web.Script.Services.ScriptService()> _
Public Class EmpWS
Inherits System.Web.Services.WebService
<WebMethod()> _
Public Function FindEmployee(ByVal prefixText As String) As List(Of String)
Dim json As New System.Web.Script.Serialization.JavaScriptSerializer
Dim list As List(Of String)
list = WebServices.clsWebService.GetEmps(prefixText)
Dim str As String = Nothing
Try
str = json.Serialize(list)
Catch ex As Exception
End Try
Return list.ToArray().ToList
End Function
End Class
任何想法我错过了什么?