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