Ajax自动完成扩展程序在vb .net中不起作用 [英] Ajax Autocomplete extender is not working in vb .net

查看:87
本文介绍了Ajax自动完成扩展程序在vb .net中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨专家,

我想在我的项目中添加ajax autocomplete extender,它是在vb中创建的。

但是服务方法没有调用。它工作不正常请帮我解决这个问题。



我的代码是

 <   asp:TextBox     ID   =  txtSearch    runat   =  server    AutoCompleteType   =  FirstName   >  <   / asp:TextBox  >  
< asp:AutoCompleteExtender < span class =code-attribute> ID = ACEtxtSearch runat = server MinimumPrefixLength = 0

ServiceMethod = < span class =code-keyword> GetCompletionList 已启用 = True TargetControlID = txtSearch

EnableCaching = true FirstRowSelected = true

CompletionInterval = 10 CompletionSetCount = 10 CompletionListCssClass = completionList CompletionListItemCssClass = listItem

CompletionListHighlightedItemCssClass = itemHighlighted > ;
< / asp:AutoCompleteExtender >



vbcode

< WebMethod()> _ 
函数 GetCompletionList( ByVal prefixText As 字符串 ByVal count 作为 整数作为 字符串()

结束 功能



请帮我解决这个问题

提前谢谢

(Keerthi Kumar)

解决方案

更改你的网页方法签名如下

< system.web.script.services.scriptmethod(),> System.Web.Services.WebMethod()> _ 
公开 共享 功能 GetCompletionList( ByVal prefixText As String ,< span class =code-keyword> ByVal count 作为 整数作为列表( 字符串


结束 功能



最好在 ASP.Net中的AJAX AutoCompleteExtender示例中关注词干[ ^ ]


Hi experts,
i want to add ajax autocomplete extender in my project that has been created in vb.
but service method is not calling. Its not working properly please help me solve this issue.

my code is

<asp:TextBox ID="txtSearch" runat="server" AutoCompleteType="FirstName" ></asp:TextBox>
<asp:AutoCompleteExtender ID="ACEtxtSearch" runat="server" MinimumPrefixLength="0"

ServiceMethod="GetCompletionList" Enabled="True" TargetControlID="txtSearch" 

EnableCaching="true" FirstRowSelected="true"

CompletionInterval="10" CompletionSetCount="10" CompletionListCssClass="completionList" CompletionListItemCssClass="listItem"

CompletionListHighlightedItemCssClass="itemHighlighted">
</asp:AutoCompleteExtender>


vbcode

<WebMethod()> _
Function GetCompletionList(ByVal prefixText As String, ByVal count As Integer) As String()

End Function


please help me solve this issue
thanks in advance
(Keerthi Kumar)

解决方案

change your web method signature as below

<system.web.script.services.scriptmethod(),>System.Web.Services.WebMethod()> _
Public Shared Function GetCompletionList(ByVal prefixText As String, ByVal count As Integer) As List(Of String)


End Function


And you better follow the stems in AJAX AutoCompleteExtender Example in ASP.Net[^]


这篇关于Ajax自动完成扩展程序在vb .net中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆