自动完成搜索文本框? [英] autocomplete search textbox?

查看:198
本文介绍了自动完成搜索文本框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

搜索文本框"是否具有与自动完成编码的文本框"相同的功能? :confused:

is "search textbox" has same function with the "textbox" coded with autocomplete? :confused:

推荐答案

普通文本框不包含您愿意创建的自动功能或通过互联网使用的现有功能
检查此

http://jamesgeraldlgayo.webng.com/dhtmlcombobox/DHTMLCombobox.htm [
Normal text boxes doesn''t contain any autocomeletly functionaly you have eiter to creat your own, or use exisitng ones over the internet
check this

http://jamesgeraldlgayo.webng.com/dhtmlcombobox/DHTMLCombobox.htm[^]


团队;
自动完成搜索文本框?
希望对您有帮助.


不要忘记投票;)

普通的文本框不包含您希望借助Ajax/Jquery进行的任何自动完成功能.

对于Ajax,您必须编写一个Web方法
1)


[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]

公共字符串[] GetCompletionList(字符串prefixText,整数计数)
{
DataTable dt = objBAL.GetDataSet(从tbl_product中选择Product_name,其中Product_name如""+ prefixText +"%").Tables [0];
string []项目=新的string [dt.Rows.Count];
int i = 0;
foreach(在dt.rows中的DataRow dr)
{
items.SetValue(dr [0] .ToString(),i);
i ++;
}

退换货品;

}

如何使用该方法
调用AutoCompleteExtender(ServiceMethod)中的方法
< cc1:AutoCompleteExtender runat ="server"
ID ="autoComplete1"
TargetControlID ="txtDGName"
ServiceMethod ="GetCompletionList"
ServicePath =〜/WebService.asmx"
MinimumPrefixLength ="1"
CompletionInterval ="1000"
EnableCaching ="true"
CompletionSetCount ="20"
ShowOnlyCurrentWordInCompletionListItem ="true">
< Animations>
</动画>
</cc1:AutoCompleteExtender>





谢谢's
Prasanta Kumar Pradhan
Hi Team;
autocomplete search textbox?
Hope It Will Help You .


Don''t Forget To Vote ;)

Normal text boxes doesn''t contain any autocomeletly functionaly you have eiter take the helpe of Ajax/Jquery.

For Ajax You Must write a web method
1)


[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]

public string[] GetCompletionList( string prefixText, int count)
{
DataTable dt = objBAL.GetDataSet("select Product_name from tbl_product where Product_name like ''" + prefixText + "%''").Tables[0];
string[] items = new string[dt.Rows.Count];
int i = 0;
foreach (DataRow dr in dt.Rows)
{
items.SetValue(dr[0].ToString(), i);
i++;
}

return items;

}

How you consume the method
Call the method in AutoCompleteExtender(ServiceMethod)
<cc1:AutoCompleteExtender runat="server"
ID="autoComplete1"
TargetControlID="txtDGName"
ServiceMethod="GetCompletionList"
ServicePath="~/WebService.asmx"
MinimumPrefixLength="1"
CompletionInterval="1000"
EnableCaching="true"
CompletionSetCount="20"
ShowOnlyCurrentWordInCompletionListItem="true">
<Animations>
</Animations>
</cc1:AutoCompleteExtender>





Thank''s
Prasanta Kumar Pradhan


这篇关于自动完成搜索文本框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆