Autocomplete Extender: Issue with hyphen symbol on the textbox

Discussion in 'ASP .Net' started by Rey, May 22, 2008.

  1. Rey

    Rey Guest

    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, May 22, 2008
    #1
    1. Advertising

  2. Rey

    Rey Guest

    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, May 27, 2008
    #2
    1. Advertising

  3. Rey

    warrenvt

    Joined:
    Jun 17, 2008
    Messages:
    3
    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.
     
    warrenvt, Jun 19, 2008
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. GMartin
    Replies:
    0
    Views:
    405
    GMartin
    Nov 20, 2006
  2. =?Utf-8?B?Ym9iYnk=?=

    AutoComplete extender

    =?Utf-8?B?Ym9iYnk=?=, Sep 13, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    690
    densial
    Sep 13, 2007
  3. Juan Romero

    Autocomplete Extender

    Juan Romero, Oct 3, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    752
    Lloyd Sheen
    Oct 3, 2007
  4. Stefan Filip

    AJAX Autocomplete Extender problem

    Stefan Filip, Nov 21, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    5,324
    yuriy.loginov
    Aug 28, 2012
  5. JM_newsgroups
    Replies:
    0
    Views:
    712
    JM_newsgroups
    Jun 12, 2008
Loading...

Share This Page