简体   繁体   English

ASP.NET Ajax AutoComplete不绑定值吗?

[英]ASP.NET Ajax AutoComplete Not binding values?

Iam using AJax: AUtoComplete in asp.net IAM使用AJax:asp.net中的AUtoComplete

Iam using WebMethod for the same page, 我在同一页面上使用WebMethod,

That webmethod is getting called and its returning values too.., But those values are not getting bind to the TextBox. 该webmethod被调用,并且其返回值也..,但是这些值未绑定到TextBox。

Here is my ASPX code: 这是我的ASPX代码:

 <asp:ScriptManagerProxy ID="AjaxMgrPrxy" runat="server" ></asp:ScriptManagerProxy> 

     <asp:TextBox runat="server" ID="txtacService" AutoPostBack="true" ></asp:TextBox>

      <div id="divwidth"></div>

                 <ajax:AutoCompleteExtender ID="acService"  
                     TargetControlID="txtacService"  
                     runat="server" 
                     ServiceMethod="GetServiceNames" 
                     MinimumPrefixLength="1" 
                     EnableCaching="true" 
                     CompletionSetCount="1" 
                     CompletionInterval="200" 
                     CompletionListElementID="divwidth" 
                     ServicePath="PortOmission.aspx" 
                     FirstRowSelected="true"/>

Code Behind: 背后的代码:

[System.Web.Script.Services.ScriptMethod()]
[System.Web.Services.WebMethod]
public static string[] GetServiceNames(string prefixText)
{
   // Code Here
   return List.ToArray();
}

Did i miss come thing here??? 我想念这里的东西吗? I was looking into this code since few hrs.., i Could not get any useful result., 几个小时以来,我一直在研究这段代码。.,我无法获得任何有用的结果。,

Can any one please help me to find out this problem., 谁能帮我找出这个问题。,

If your service is in the same page as your textbox control is, just use 如果您的服务与文本框控件位于同一页面,则只需使用

ServiceMethod="GetServiceNames" ServicePath="" ServiceMethod =“ GetServiceNames” ServicePath =“”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM