自动完成,Web服务未触发 [英] AutoComplete, Web Service is not firing

查看:86
本文介绍了自动完成,Web服务未触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好



这里我编写了自动完成代码......当我在文本框中输入完整行将会消失的内容...

此处.aspx代码

Hi all

Here i had written code for AutoComplete... when i enter something in textbox that full row will went off...
here .aspx code

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
 <asp:TemplateField HeaderText="Mode">
                            <ItemTemplate>
                                <asp:ScriptManagerProxy ID="ScriptManagerProxy3" runat="server">
                                    <Services>
                                        <asp:ServiceReference Path="~/WebService1.asmx" />
                                    </Services>
                                </asp:ScriptManagerProxy>
                                <asp:TextBox ID="txtFinancialInstrumentName" autocomplete="off" runat="server" AutoPostBack="true" Text='<%# Bind("FinancialInstrumentName")%>' OnTextChanged="TxtReceipt_TextChanged" Columns="15" MaxLength="10"></asp:TextBox>
                                <asp:AutoCompleteExtender ID="txtFinancialInstrumentName_AutoCompleteExtender" FirstRowSelected="true" runat="server" CompletionInterval="1" CompletionSetCount="10" DelimiterCharacters="" Enabled="True" MinimumPrefixLength="1" ServiceMethod="GetFinList" ServicePath="~/WebService1.asmx" TargetControlID="txtFinancialInstrumentName" UseContextKey="True" EnableCaching="true" ViewStateMode="Enabled"  >
                                </asp:AutoCompleteExtender>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Left" />
                            <ItemStyle HorizontalAlign="Left" />
                        </asp:TemplateField>



我的Web服务页面是WebService1.asmx


And my Web Service Page is WebService1.asmx

Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.ComponentModel
Imports Rashmika.Healthcare.Library

' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
' <System.Web.Script.Services.ScriptService()> _
<System.Web.Services.WebService(Namespace:="http://tempuri.org/")> _
<System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<ToolboxItem(False)> _
Public Class WebService1
    Inherits System.Web.Services.WebService
    <WebMethod()> _
    Public Function HelloWorld() As String
        Return "Hello World"
    End Function

    <System.Web.Services.WebMethod> _
   <System.Web.Script.Services.ScriptMethod> _
    Public Shared Function GetFinList(ByVal prefixText As String) As List(Of String)
        Dim List As List(Of FinancialInstrument) = Financial.FilterByName(prefixText.Trim)
        Dim ReturnList As New List(Of String)
        For Each FinancialInstrument In List
            ReturnList.Add(AjaxControlToolkit.AutoCompleteExtender.CreateAutoCompleteItem(FinancialInstrument.Name, FinancialInstrument.Id))
        Next
        Return ReturnList
    End Function

    <System.Web.Services.WebMethod> _
    <System.Web.Script.Services.ScriptMethod> _
    Public Shared Function GetBankList(ByVal prefixText As String) As List(Of String)
        Dim List As List(Of Bank) = Prefix.FilterByName(prefixText.Trim)
        Dim ReturnList As New List(Of String)
        For Each Bank In List
            ReturnList.Add(AjaxControlToolkit.AutoCompleteExtender.CreateAutoCompleteItem(Bank.Name, Bank.Id))
        Next
        Return ReturnList
    End Function
End Class



如何解决这个问题?


how do i solve this?

推荐答案

请从txtFinancialInstrumentName文本框控件中删除autocomplete =off属性。
Please remove "autocomplete="off" property from "txtFinancialInstrumentName" textbox control.


这篇关于自动完成,Web服务未触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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