zoukankan      html  css  js  c++  java
  • Ajax Control Toolkits 2008遇到的问题

    Ajax Control Toolkits dll版本 3.0.20229.0

    在使用AutoCompleteExtender时使用WebService配置时总是不成功。好像根本没有走到后台的代码。

    大概代码如下:

    情况1:

    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

    <cc1:AutoCompleteExtender ID="TextBox1_AutoCompleteExtender" runat="server" MinimumPrefixLength="1"

    ServiceMethod="GetMyFriends" ServicePath="http://localhost:10085/WebUI/WS/WebSearch.asmx"

    TargetControlID="TextBox1" ></cc1:AutoCompleteExtender>

    ===============================================

    [WebMethod]

    public string[] GetMyFriends(string prefixText,int count)

    {

       return new string[]{"Hello","World","Mary","Kay"};

    }


    情况2:

    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

    <cc1:AutoCompleteExtender ID="TextBox1_AutoCompleteExtender" runat="server" MinimumPrefixLength="1"

    ServiceMethod="GetMyFriends" ServicePath="http://localhost:10085/WebUI/WS/WebSearch.asmx"

    TargetControlID="TextBox1" UseContextKey="True" ContextKey="123"></cc1:AutoCompleteExtender>

    ===============================================

    [WebMethod]

    public string[] GetMyFriends(string prefixText,int count,string contextKey)

    {

       return new string[]{"Hello","World","Mary","Kay"};


    但是可以使用一种类似本地代码的WEBSERVICE

    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

    <cc1:AutoCompleteExtender ID="TextBox1_AutoCompleteExtender" runat="server" MinimumPrefixLength="1"

    ServiceMethod="GetCompletionList" CompletionSetCount="10" ServicePath=""

    TargetControlID="TextBox1" UseContextKey="True" ContextKey="123"></cc1:AutoCompleteExtender>

    ===============================================

    [System.Web.Services.WebMethodAttribute(),System.Web.Script.Services. ScriptMethodAttribute()]

    public static string[] GetCompletionList(string prefixText,int count, string contextKey)

    {

       return new string[]{"Hello","World","Mary","Kay"};

    我在网上找一圈没找到具体的原因,把自己测试的结果发上来共大家参考!


  • 相关阅读:
    bzoj3505 数三角形 组合计数
    cogs2057 殉国 扩展欧几里得
    cogs333 荒岛野人 扩展欧几里得
    bzoj1123 BLO tarjan求点双连通分量
    poj3352 road construction tarjan求双连通分量
    cogs1804 联合权值 dp
    cogs2478 简单的最近公共祖先 树形dp
    cogs1493 递推关系 矩阵
    cogs2557 天天爱跑步 LCA
    hdu4738 Caocao's Bridge Tarjan求割边
  • 原文地址:https://www.cnblogs.com/kaixuanpisces/p/1370501.html
Copyright © 2011-2022 走看看