我正在尝试使用ajax自动完整扩展程序,但它无法正常工作.... 我在Web服务中的GetCompanyNames方法上设置了一个断点,但它甚至没有达到断点。
这是我的ajax autoextender
<asp:TextBox TabIndex="1" ToolTip="* Required - enter the Company name" ID="txtCompanyName"
runat="server"></asp:TextBox>
<ajaxToolkit:AutoCompleteExtender runat="server" ID="acCompanyName" TargetControlID="txtCompanyName" ServiceMethod="GetCompanyNames" ServicePath="~/WebServices/AutoComplete.asmx" MinimumPrefixLength="1"
EnableCaching="true">
</ajaxToolkit:AutoCompleteExtender>
这是我创建的网络服务
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
' <System.Web.Script.Services.ScriptService()> _
<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<System.Web.Script.Services.ScriptService()> _
Public Class AutoComplete
Inherits System.Web.Services.WebService
<WebMethod()> _
Public Function HelloWorld() As String
Return "Hello World"
End Function
<WebMethod()> _
Public Function GetCompanyNames(ByVal prefixTest As String) As String()
Dim db As New DataClassesDataContext
Dim company = From c In db.CT_Companies
Where c.CompanyName.Contains(prefixTest)
Select c.CompanyName
Return company.ToArray
End Function
End Class
有人能看到我做错了什么或错过了吗?感谢