ServiceMethod未被调用。那不是开枪。我已经通过在下面的以下行中设置断点来确定这一点:
namespace IncidentManagement
{
/// <summary>
/// Summary description for WebService1
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo=WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script,using ASP.NET AJAX, uncomment the following line.
[System.Web.Script.Services.ScriptService]
public class WebService1 : System.Web.Services.WebService
*(breakpoint here)* {
[System.Web.Script.Services.ScriptMethod()]
[System.Web.Services.WebMethod]
public static List<string> GetAddress(string prefixText, int count)
{...}
}
我已经审查了此处发布的评论和答案以及其他许多评论。我的ServiceMethod产生正确的结果。我通过将服务方法复制到.aspx文件并从Page_Load运行它来确定这一点。将参数传递给该方法产生了预期的结果。问题出在未调用ServiceMethod和未调用WebService。我的AutoCompleteExtender和相关代码在下面列出。
谢谢。
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ccl" %>
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
</asp:ScriptManager>
<asp:TextBox ID="TextBox18" Style="float: left" runat="server" AutoPostBack="true" Height="17px" Width="75px">
</asp:TextBox>
<ccl:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server"
ServicePath="~/WebService1.asmx"
ServiceMethod="GetAddress"
CompletionInterval="100"
EnableCaching="false"
CompletionSetCount="10"
TargetControlID="TextBox18"
FirstRowSelected="false"
MinimumPrefixLength="1">
</ccl:AutoCompleteExtender>