locked
How to generate tags list available in database using ajax instead of JQuery RRS feed

  • Question

  • User-786564416 posted

    I have a textbox. What I want is that when I start typing, I want to see all the list of the tags from database that has the same starting string I am typing.

    I made this before using the jQuery. Now, I want to make it using another technique, like AJAX or others. Is it possible?

    Tuesday, April 16, 2019 1:03 PM

All replies

  • User288213138 posted

    Hi  About alihusain_77,
     
    It can generate tags list available in database using ajax, You can implement it using the ComboBox control, and the use the ComboBox DropDownStyle property to change the behavior of the ComboBox.
     

    The code:

    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
    
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
                <ajaxToolkit:ComboBox ID="ComboBox1" runat="server" DataSourceID="SqlDataSource1" DataTextField="Name" DataValueField="Name" MaxLength="0" style="display: inline;" AutoCompleteMode="SuggestAppend">
                </ajaxToolkit:ComboBox>
                <asp:Button ID="Button1" runat="server" Text="Submit" OnClick="Button1_Click" />
                <hr />
                <asp:Label ID="Label1" runat="server"></asp:Label>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="select * from fiels"></asp:SqlDataSource>
    

    The Result:
     


    You can also use this control, AutoCompleteExtender, to do what you want, and this is the reference link:

    https://forums.asp.net/t/2139424.aspx?How+to+hide+an+element+in+AutoCompleteExtender+from+displaying+
     
    Best Regard,
    Sam

    Wednesday, April 17, 2019 9:42 AM