assigning autocomplete contextKey using Javascript

Last post 02-09-2009 2:30 PM by meSync. 2 replies.

Sort Posts:

  • assigning autocomplete contextKey using Javascript

    06-27-2008, 5:11 PM
    • Member
      81 point Member
    • jonny75904
    • Member since 04-24-2006, 3:33 PM
    • Houston TX
    • Posts 201

    I need to use the contextKey field to send an additional parameter to my web service.  In this case, it is the value of another textbox.  I need to do this using javascript, preferrably inline javascript.  However, when the webmethod is called, all the javascript code comes through in the variable instead of the textbox value.  How can I assign the textbox value to the context key using javascript?

    I have tried:

     
    <cc1:AutoCompleteExtender
    runat="server"
    ID="autoComplete1"
    TargetControlID="txtCountry"
    ServicePath="~/ScriptServices/AutoComplete.asmx"
    ServiceMethod="Countries"
    MinimumPrefixLength="1"
    CompletionInterval="10"
    EnableCaching="true"
    CompletionSetCount="12"
    FirstRowSelected="true"
    CompletionListItemCssClass="AutoCompleteList"
    CompletionListHighlightedItemCssClass="AutoCompleteListHighlighted"
    UseContextKey="true" ContextKey="document.getElementById('txtState').value;"
    />

    and I have tried

     
    <cc1:AutoCompleteExtender
    runat="server"
    ID="autoComplete1"
    TargetControlID="txtCountry"
    ServicePath="~/ScriptServices/AutoComplete.asmx"
    ServiceMethod="Countries"
    MinimumPrefixLength="1"
    CompletionInterval="10"
    EnableCaching="true"
    CompletionSetCount="12"
    FirstRowSelected="true"
    CompletionListItemCssClass="AutoCompleteList"
    CompletionListHighlightedItemCssClass="AutoCompleteListHighlighted"
    UseContextKey="true" ContextKey="javascript:document.getElementById('txtState').value;"
    />
     

     Please help!

    "Everything should be made to be as simple as possible, and not simpler." -Albert Einstein
  • Re: assigning autocomplete contextKey using Javascript

    09-09-2008, 2:09 AM
    • Member
      223 point Member
    • waheed
    • Member since 06-15-2006, 5:59 AM
    • Posts 65

    did you ever got any answer to this?

    Waheed Hussain,
    .Net Consultant,
    email:waheed.hussain@hotmail.com.
  • Re: assigning autocomplete contextKey using Javascript

    02-09-2009, 2:30 PM
    • Member
      4 point Member
    • meSync
    • Member since 11-06-2006, 8:01 PM
    • Indiana
    • Posts 2

     The solution is here:

    http://forums.asp.net/t/1119865.aspx

    Jacob R. Miller
    MeSync Technologies Inc.
    MeSync@gmail.com
    www.MeSync.com
Page 1 of 1 (3 items)