Autocomplete Extender: Issue with hyphen symbol on the textbox

  • Thread starter Thread starter Rey
  • Start date Start date
R

Rey

I have a textbox and linked that with the autocomplete extender
I have created the webservice and the WebMethod and returns a ToArray to
the textbox. Everything works when I type normal string characters but there
is a glitch when I type an hyphen character the autocomplete list starts over
or breaks in other words for eg if I want to search "05-8900-09" as soon as
I type "05-" the list will show as:
-8900
-8901 (it omits 05- and the rest of the string characters)

It doesnt display the entire string, I have tried testing the Webmethod and
able to pull the entire list in xml format and also traced the WebMethod
Toarray returns the entrie string. I dont know what could be the problem.

I am pretty okay with the webmethod logic because I am able to get the
string() in the debugger its only at runtime I am not able to see the
complete list.

I am suspecting something to do with the stylesheet white-space:nowrap

here is my control

<asp:TextBox ID="tAssay" style="white-space:nowrap;"
runat="server"></asp:TextBox>
<cc1:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server"
MinimumPrefixLength="2" ServiceMethod="GetCompleteList"
ServicePath="AutoComplete.asmx" TargetControlID="tAssay"
CompletionListCssClass="autocomplete_completionList "
CompletionListHighlightedItemCssClass="autocomplete_Highlighted"
CompletionListItemCssClass="autocomplete">
</cc1:AutoCompleteExtender>


..autocomplete_highlighted
{
white-space: nowrap !important;
}

Can Somebody help me with this


Thanks,
Rey
 
Figured it out! When there are numbers followed by hyphen it is better to give
them inside the '' single quotes and autocomplete will provide the full
entry during run time...it took a while for me, hope this would help somebody
:-) here is it

For Each dr In Results.Table.Rows
If Not (dr("sample_number").ToString Is System.DBNull.Value)
Or Len(dr("sample_number").ToString) > 0 Then
Sample_Number = "'" & dr("sample_number").ToString & "'"
'Note the Single Quote
items.SetValue(Sample_Number, i)
i = i + 1
End If
Next
 
Back
Top