.NET开发

常用链接

统计

最新评论

AutoCompleteExtender 不工作的处理

最新版本的AutoCompleteExtender不工作,CTP  1.0 Beta版

主要发现 AutoCompleteExtender不触发WebService的工作函数

WebService.cs文件 作如下改动后,可正常使用
1、引用Microsoft.Web.Script.Services;
2、将[WebService(Namespace = "http://tempuri.org/")]
   [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]]两句删除掉
增加[ScriptService]
即可
参考:http://forums.asp.net/thread/1437583.aspx
测试的代码如下:
 1using System;
 2using System.Web;
 3using System.Collections;
 4using System.Web.Services;
 5using System.Web.Services.Protocols;
 6using Microsoft.Web.Script.Services;
 7
 8
 9[ScriptService]
10public class WebServiceTest : System.Web.Services.WebService {
11
12    public WebServiceTest () {
13
14        //Uncomment the following line if using designed components 
15        //InitializeComponent(); 
16    }

17
18    [WebMethod]
19    public string[] GetSuggestions(string prefixText, int count)
20    {
21        string[] r = new string[count];
22<span style="COLOR: #

posted on 2006-10-30 11:45 加林仙人 阅读(1782) 评论(5)  编辑 收藏 网摘 所属分类: .NET(C#)

评论

#1楼 2006-10-30 18:59 沛沛      

能不能告诉我们,是什么原因导致AutoCompleteExtender不工作,而为什么要这么修改呢   回复  引用  查看    

#2楼 2006-10-30 22:39 attraction

只需直接增加 using Microsoft.Web.Script.Services和[ScriptService]就可以。   回复  引用    

#3楼 2006-10-31 00:02 Dflying Chen      

@沛沛
加了[ScriptService]属性之后,Atlas才会为该Web Method生成客户端JavaScript代理。只有通过这个代理,客户端才能用JavaScript访问到服务器端的这个Web Method。
  回复  引用  查看    

#4楼 2007-09-25 12:34 AAAAAAAAAAAAA[未注册用户]

你想...我想问一下...我的加了using Microsoft.Web.Script.Services和[ScriptService]后会提示这个错误...Error 1 The type or namespace name 'Script' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) E:\Test\CH3_Test\App_Code\SimpleWebService.cs 6 18 E:\Test\CH3_Test\


我要怎么样修改...谢谢...
  回复  引用    

#5楼 2007-10-30 16:36 Dean Chang[未注册用户]

不需要 using Microsoft.Web.Script.Services,也不需要刪除資料,請直接多加一行[System.Web.Script.Services.ScriptService]即可。
eg.
namespace Test
{
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.Web.Script.Services.ScriptService]
public class AutoCompleteService : System.Web.Services.WebService
{
}
}
  回复  引用    




发表评论

昵称: [登录] [注册]

主页:

邮箱:(仅博主可见)

评论内容:

  登录  注册

[使用Ctrl+Enter键快速提交评论]

0 544292




相关文章:

相关链接: