Wednesday, March 28, 2012

ContextKey not working in AutoCompleteExtender

My project works fine if I do not useContextKey at all.

If I remove ContextKey from VB code and removeUseContextKey,ContextKey fromHTML it works fine.

Here's my VB code and HTML declaration

Pl let me know what I need to do to make it work.

TIA

------------------

PublicFunction GetCompletionList(ByVal prefixTextAsString,ByVal countAsInteger,ByVal ContextKeyAsString)AsString()

------------------

<cc2:AutoCompleteExtenderID="AutoCompleteExtender1"runat="server"

TargetControlID="txtFirstName"ServicePath="AutoComplete.asmx"

ServiceMethod="GetCompletionList"UseContextKey="true"ContextKey="First_Name"MinimumPrefixLength="1"

CompletionInterval="1000"EnableCaching="true"CompletionSetCount="12">

</cc2:AutoCompleteExtender>

What does not work if you use the context key? Does it not return any results? Does it not use the context key? Do you get a javascript error? Have you taken a look at the usage of ContextKey in the Toolkit solution. You should find some under the ToolkitTests project or if you download the code from the Development tree then under Testing.Client project.


Hi MP11,

If you do some modifications on your web.config, we suggest that you should save the web.config without any changes to avoid the cache issues before your debug it. If it doesn't work, please add breakpoints to your webservice to debug it step-by-step.

I hope this help.

Best regards,

Jonathan


Kirti

If I drop ", ByVal ContextKey As String" from web service VB code and drop the "UseContextKey="true" ContextKey="First_Name"" from HTML, AutoCompleteExtender works just fine.

Jonathan,

I have a break point in VB code but it does not break when I use contextkey. It breaks if I do not use ContextKey.

Mahesh


PS I did not make it very clear about what I want to do. I want to call the same web service method for two different textboxes viz. txtFirstName and txtLastName. I want to pass a parameter value txtFirstName or txtLastName via ContextKey.


Hi MP11,

mp11:

PublicFunction GetCompletionList(ByVal prefixTextAsString,ByVal countAsInteger,ByVal ContextKeyAsString)AsString()

Please useByValcontextKeyAsString)AsString() instead ofContextKey. It is recommended that you should save your web.config without any modifications before you debug it if you have done some changes to the WebService.

I hope this help.

Best regards,

Jonathan


Jonathan,

I'm back after a brief vacation.

Your suggestion about contextKey worked.

Thanks a lot.

No comments:

Post a Comment