0

I have an autocomplete extender on my ASP.NET page and have set the "EnableCaching" attribute to "true".

Based on some conditions I want to clear the autocomplete extender's cache (I am not referring to the data cache that I am using in my Autocomplete Web Service - I am talking about the client-side cache used by the Auto Complete Extender.)

One obvious solution would be to just set "EnableCaching" to false, but this would result in my Database suffering far too many queries.

Can this be done via javascript, or any other way for that matter?

RichardTheKiwi
  • 105,798
  • 26
  • 196
  • 262
Wynand Murray
  • 73
  • 1
  • 1
  • 8

2 Answers2

1

Try this: $find("<%= Extender.ClientID %>")._cache = [];

Yuriy Rozhovetskiy
  • 22,270
  • 4
  • 37
  • 68
1

Hi Yuriy and thanks for your response! I have not yet tested your solution as I managed to stumble upon the solution after playing around with my code for a bit.

The following line of JavaScript seemed to do the trick for me:

$find('AutoCompleteEx')._cache=null;

To those who need some extra explaining, 'AutoCompleteEx' is the value assigned to your autocomplete extender's "BehaviourID" property.

I hope this helps someone out there!

Wynand Murray
  • 73
  • 1
  • 1
  • 8
  • This should be the accepted answer as it's the behavior, not the extender that you want. $find("<%= Extender.ClientID %>")._cache results in an error.... but we should all get downvotes for using Microsoft controls... – user1566694 Nov 16 '16 at 22:11