locked
Sending multiple parameters to AutoComplete extender in asp.net using web method RRS feed

All replies

  • User-1838255255 posted

    Hi kengkit,

    About pass multiple parameters to webmethod or webservice with AutoComplete extender, you could use ContextKey property.

    1. You could use UseContextKey ="true".

    2. You could set the value of the contextkey in JS.

    Sample Code:  

    <asp:TextBox ID="txtContactsSearch" runat="server" onkeyup = "SetContextKey()"></asp:TextBox>
    <cc1:AutoCompleteExtender ServiceMethod="SearchCustomers"
        MinimumPrefixLength="2"
        CompletionInterval="100" EnableCaching="false" CompletionSetCount="10" 
        TargetControlID="txtContactsSearch" UseContextKey = "true"
        ID="AutoCompleteExtender1" runat="server" FirstRowSelected = "false">
    </cc1:AutoCompleteExtender>

    For more details, please refer to these tutorials:

    ASP.Net AJAX AutoCompleteExtender: Pass Additional Parameter to WebMethod using ContextKey:

    https://www.aspsnippets.com/Articles/ASPNet-AJAX-AutoCompleteExtender-Pass-Additional-Parameter-to-WebMethod-using-ContextKey.aspx 

    Best regards,

    Eric Du

    Friday, May 26, 2017 7:34 AM