<
td
class
=
"
style23
"
>
< asp:TextBox ID = "tbN um " BackColor = " #CCFFFF " runat = " server " AutoCompleteType = " Disabled "
Width = " 289px " ></ asp:TextBox >
< asp:AutoCompleteExtender ID = "tbNum _AutoCompleteExtender " runat = " server " FirstRowSelected = " true "
Enabled = " True " ServicePath = " Infor.asmx " ServiceMethod = " GetTableInfor "
TargetControlID = "tbN um " MinimumPrefixLength = " 1 " EnableCaching = " true " CompletionSetCount = " 10 "
CompletionInterval = " 100 " UseContextKey = " True " >
</ asp:AutoCompleteExtender >
</ td >
< asp:TextBox ID = "tbN um " BackColor = " #CCFFFF " runat = " server " AutoCompleteType = " Disabled "
Width = " 289px " ></ asp:TextBox >
< asp:AutoCompleteExtender ID = "tbNum _AutoCompleteExtender " runat = " server " FirstRowSelected = " true "
Enabled = " True " ServicePath = " Infor.asmx " ServiceMethod = " GetTableInfor "
TargetControlID = "tbN um " MinimumPrefixLength = " 1 " EnableCaching = " true " CompletionSetCount = " 10 "
CompletionInterval = " 100 " UseContextKey = " True " >
</ asp:AutoCompleteExtender >
</ td >
Infor.asmx文件
[WebMethod]
public string [] GetTableInfor( string prefixText, int count)
{
string SQL_STR = " select top 10 ProNum from Tables where ProNum like '% " + prefixText + " %' " ;
DataSet ds = SQLHelper.Query(SQL_STR);
count = ds.Tables[ 0 ].Rows.Count;
string [] array = new string [count];
for ( int i = 0 ; i < count; i ++ )
{
array[i] = ds.Tables[ 0 ].Rows[i][ " NumName " ].ToString();
}
return array;
}
public string [] GetTableInfor( string prefixText, int count)
{
string SQL_STR = " select top 10 ProNum from Tables where ProNum like '% " + prefixText + " %' " ;
DataSet ds = SQLHelper.Query(SQL_STR);
count = ds.Tables[ 0 ].Rows.Count;
string [] array = new string [count];
for ( int i = 0 ; i < count; i ++ )
{
array[i] = ds.Tables[ 0 ].Rows[i][ " NumName " ].ToString();
}
return array;
}