求解AutoCompleteExtender不提示的问题
时间:2011-06-16
来源:互联网
页面源码
C# code
WebService.cs
C# code
我左检查,右检查可是都没发现错误。 但它就是不显示。
C# code
<td>项目搜索:</td> <td><asp:TextBox runat="server" ID="txtProing"></asp:TextBox></td> <td> <asp:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" TargetControlID="txtProing" MinimumPrefixLength="1" ScriptPath="E:\SVN\TMS\TMS\WebService.asmx" ServiceMethod="GetMyString" CompletionInterval="100"> </asp:AutoCompleteExtender>
WebService.cs
C# code
using System; using System.Collections; using System.Linq; using System.Web; using System.Web.Services; using System.Web.Services.Protocols; using System.Xml.Linq; using System.Collections.Generic; using System.Data.SqlClient; using System.Data; /// <summary> /// Summary description for WebService /// </summary> [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. [System.Web.Script.Services.ScriptService] public class WebService : System.Web.Services.WebService { public WebService () { //Uncomment the following line if using designed components //InitializeComponent(); } [WebMethod] public string[] GetMyString(string prefixText,int count) { List<string> ListItem=new List<string>(); string conn ="server=.;database=TMS;trusted_connection=true"; string Transql = "select ProjectName from ProjectName where ProjectName like '%" + prefixText + "%'"; SqlConnection connection=new SqlConnection(conn); connection.Open(); SqlCommand cmd = connection.CreateCommand(); cmd.CommandText = Transql; SqlDataAdapter dataAdapter=new SqlDataAdapter(); DataTable dataTable=new DataTable(); dataAdapter.Fill(dataTable); for(int i=0;i<dataTable.Rows.Count;i++) { ListItem.Add(dataTable.Rows[i][1].ToString()); } dataTable.Dispose(); connection.Close(); return ListItem.ToArray(); } }
我左检查,右检查可是都没发现错误。 但它就是不显示。
作者: chenhongjun0624 发布时间: 2011-06-16
怎么没有人呢
坐等高手
坐等高手
作者: chenhongjun0624 发布时间: 2011-06-16
谁来 回答一下啊 , 哪怕不对也好啊
作者: chenhongjun0624 发布时间: 2011-06-16
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28