关于autocompleteextender这个控件!!!

a64586813 2009-04-08 06:20:20

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
//若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消对下行的注释。
[System.Web.Script.Services.ScriptService]
public class ProductAutoComplete : System.Web.Services.WebService {

public ProductAutoComplete () {

//如果使用设计的组件,请取消注释以下行
//InitializeComponent();
}

[WebMethod]
[ScriptMethod]
public string[] GetProductName(string prefixText, int count)
{
List<string> suggestions = new List<string>(count);
SQL sql = new SQL();
suggestions = sql.getSearchProduct(prefixText);
return suggestions.ToArray();
}

}

这是Webservice里的代码


<asp:TextBox ID="TextBox1" runat="server" Width="410px" AutoPostBack="False" />
<cc1:AutoCompleteExtender ID="TextBox1_AutoCompleteExtender" runat="server"
TargetControlID="TextBox1" ServiceMethod="GetProductName" ServicePath="~/App_Code/ProductAutoComplete.cs" MinimumPrefixLength="1" Enabled="True">
</cc1:AutoCompleteExtender>


这是页面上的代码,这样写哪里错了啊?????为什么没有实现自动完成填写的功能???
...全文
49 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

52,782

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Ajax
社区管理员
  • Ajax
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧