locked
Autocomplete Textchanged event is not firing RRS feed

  • Question

  • User840052993 posted

    ajax auto complete textchanged event is not firing , when selecting same item second time. 

    plz help...

    Friday, March 6, 2015 4:52 AM

Answers

  • User61956409 posted

    Hi vjnithin,

    Thanks for your post.

    Firstly, do you set TextBox.AutoPostBack Property to true?

    <asp:TextBox ID="txName" runat="server" MaxLength="200" AutoPostBack="true" OnTextChanged="txName_TextChanged"></asp:TextBox> 

    Secondly, I create the following sample to reproduce your problem, the code works fine on my side, you could refer to it to modify your code.

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
            <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager>
            <div>
                <asp:TextBox ID="txName" runat="server" MaxLength="200" AutoPostBack="true" OnTextChanged="txName_TextChanged"></asp:TextBox>
    
                <asp:AutoCompleteExtender ServiceMethod="SearchName" DelimiterCharacters=", " ShowOnlyCurrentWordInCompletionListItem="false" MinimumPrefixLength="1"
                    CompletionInterval="0" EnableCaching="false" CompletionSetCount="10"
                    TargetControlID="txName" ID="autoCompleteExtender1" runat="server"
                    FirstRowSelected="false">
                </asp:AutoCompleteExtender>
    
                <br />
                <asp:Label ID="lblname" runat="server" Text=""></asp:Label>
            </div>
        </form>
    </body>
    </html> 
    

    protected void txName_TextChanged(object sender, EventArgs e)
    {
        string name = txName.Text.ToString();
    
        lblname.Text = "you select: " + name + " !";
    } 
    



    Best Regards,

    Fei Han

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, March 9, 2015 4:42 AM