weixin_33716941 2010-08-03 20:04 采纳率: 0%
浏览 36

MOSS 2007 Web部件中的Ajax

I am creating a web part in MOSS 2007 that contains an autocompleteextender.

I have ajax-enabled my site by adding all the configs in web.config (Example here)

My web service:

    [System.Web.Script.Services.ScriptService]
    public class AutoComplete : System.Web.Services.WebService
    {
        [System.Web.Services.WebMethod]
        [System.Web.Script.Services.ScriptMethod]
        public string[] GetCompletionList(string prefixText, int count)
        {
                    List<string> results = new List<string>();
                    results.Add("Here");
                    results.Add("Here");
                    results.Add("Here");
                    results.Add("Here");
                    results.Add("Here");
                    results.Add("Here");
                    results.Add("Here");
                    return results.ToArray();
         }
   }

I am able to hit the web service from web browser. However, the autocompleteextender does not call my web service.

My web service url: http://[myserver]/AutoComplete.asmx (I used this for the ServicePath of the extender). My web part page: http://[myserver]/Pages/mypage.aspx

I also tried to add a calendarextender onto the page and the calendar renders underneath the textbox and shows as inline html. Weird.

Any thought would be helpful.

Thanks

  • 写回答

2条回答 默认 最新

  • weixin_33744854 2010-08-04 06:32
    关注

    From you web service url it looks like you've put the web service into the root folder of your site. This will not work as this folder is handled by the SharePoint VirtualPathProvider which will look up files in the content database.

    You should put your web service into a subdirectory or either 12Hive\ISAPI or 12Hive\LAYOUTS and then call it through the corresponding

    http://[myserver]/_vti_bin/[Folder]/AutoComplete.asmx 
    

    or

    http://[myserver]/_layouts/[Folder]/AutoComplete.asmx 
    
    评论

报告相同问题?

悬赏问题

  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 用matlab 设计一个不动点迭代法求解非线性方程组的代码
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试