0

So this is about output caching, and I am trying to use <%@ OutputCache VaryByParam="">, how to realize this?

appenthused
  • 173
  • 1
  • 10

1 Answers1

0

VaryByParam refers to the query string parameters in the request url. So you would need to submit the dropdownlist values as part of the url query string.

You would probably need to use javascript to alter the request url since you would not know the selected values server side.

Brian S
  • 1,051
  • 9
  • 10
  • Thank you Brian, now I see I have to deal with querystrings. Could you please elaborate on when and how to alter my request url? Could I alter the request url in the pageload event on the server side, based on the selected value? – appenthused Nov 07 '11 at 21:11
  • The url needs to be altered before reaching the server, so that the cached page is used. So the requested page must have the right query string parameters. Since you do not know what the ddl choices will be, you will need javascript/jquery. – Brian S Nov 07 '11 at 23:22