AutoCompleteExtender 不工作
以下是我正在使用的代码,但它不起作用。
<asp:TextBox ID="txtWarrantNumber" runat="server"></asp:TextBox>
<AjaxCtrl:AutoCompleteExtender ID="acWarrantNumber" runat="server" TargetControlID="txtWarrantNumber"
ServiceMethod="GetWarrantNumber" ShowOnlyCurrentWordInCompletionListItem="true"
CompletionInterval="100" EnableCaching="true" MinimumPrefixLength="1" CompletionSetCount="4">
</AjaxCtrl:AutoCompleteExtender>
</ContentTemplate>
</asp:UpdatePanel>
</PopupTemplate>
Public Shared Function GetWarrantNumber(ByVal prefixText As String, ByVal count As Integer) As String()
Dim warrantNumbers() As String = {"ankit", "sachin", "ankrrr", "ankppp"}
Return warrantNumbers
End Function
following is the code i am using and it is not working.
<asp:TextBox ID="txtWarrantNumber" runat="server"></asp:TextBox>
<AjaxCtrl:AutoCompleteExtender ID="acWarrantNumber" runat="server" TargetControlID="txtWarrantNumber"
ServiceMethod="GetWarrantNumber" ShowOnlyCurrentWordInCompletionListItem="true"
CompletionInterval="100" EnableCaching="true" MinimumPrefixLength="1" CompletionSetCount="4">
</AjaxCtrl:AutoCompleteExtender>
</ContentTemplate>
</asp:UpdatePanel>
</PopupTemplate>
Public Shared Function GetWarrantNumber(ByVal prefixText As String, ByVal count As Integer) As String()
Dim warrantNumbers() As String = {"ankit", "sachin", "ankrrr", "ankppp"}
Return warrantNumbers
End Function
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
函数
GetWarrantNumber
需要作为 WebMethod 位于 WebService 中。您需要在 ServicePath 属性中提供 WebService.asmx 文件的位置。AutoCompleteExtender
要在没有 Web 服务的情况下执行此操作,您需要包装您的方法页面中包含以下内容:
如果您这样做,则无需提供 ServicePath。
The function
GetWarrantNumber
needs to be in a WebService as a WebMethod. And you need to provide the location of the WebService.asmx file in the ServicePath property.AutoCompleteExtender
To do this without a webservice you need wrap your method with the following within the Page:
If you do it this way then you don't need to provide a ServicePath.