Autocomplete Extender: Issue with hyphen symbol on the textbox

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
 
R

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
 
Joined
Jun 17, 2008
Messages
3
Reaction score
0
Rey said:
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



"Rey" wrote:

> 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

Rey,

WOuld this help me out. I think I'm having a similar problem to you. When I type normal characters in my autocomplete it works fine, and returns just fine. However, when I have say two worded items that have a comma and a space between them, it stops producing results.

For example:

memory1 will kick out correct results

memory1, memory2 will work until I type in the comma, then the result dropdown goes blank. Also if I type the entire thing in, it also doesn't work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top