Learner
Learner

Reputation: 1644

How To use any Parameter value for VaryByParam in caching page?

<%@ OutputCache Duration="10" VaryByParam="Button1" %>

I type the above code to vary text of Button but it does not vary the value .

Upvotes: 1

Views: 788

Answers (1)

Keltex
Keltex

Reputation: 26436

VaryByParam refers to query string parameters. Not the value of buttons or other controls.

For example:

http://www.example.com/mypage.aspx?id=10
http://www.example.com/mypage.aspx?id=20

Would be cached separately if you set:

<%@ OutputCache Duration="10" VaryByParam="id" %>

Upvotes: 6

Related Questions