J
Justice Gray
The background to my problem:
I have constructed a small web application. Each page of that web
application contains a small user control I made, that has three sections:
1) imgCompany (of type ImageButton)
My company's logo
2) imgCustomer (of type ImageButton)
The customer company's logo. The ImageUrl property changes according to the
user that is logged in...i.e. if customer is from Company A then Company A's
logo is displayed. If customer is from Company B then Company B's logo is
displayed, and so on.
3) A set of menu options that show and hide themselves according to the
prev. permissions of the user that logged in.
This needs to be shared across all pages in the site.
I thought that setting my @OutputCache directives to the following:
Directive="500"
VaryByControl="imgCustomer"
Shared="true"
would solve my difficulty.
However, in testing situtations, this is what happens:
Customer A logs in. Sees the header appropriate for Customer A. Header is
stored in cache.
Customer B logs in. Sees the header appropriate for Customer *A* (loaded
from cache).
Obviously, I want to cache each instance of the User Control that has a
different setting for imgCustomer.ImageUrl, such that Customer A will see
logo A, and customer B will see logo B. What have I done in error?
Any help would be *greatly* appreciated!
-Justice
I have constructed a small web application. Each page of that web
application contains a small user control I made, that has three sections:
1) imgCompany (of type ImageButton)
My company's logo
2) imgCustomer (of type ImageButton)
The customer company's logo. The ImageUrl property changes according to the
user that is logged in...i.e. if customer is from Company A then Company A's
logo is displayed. If customer is from Company B then Company B's logo is
displayed, and so on.
3) A set of menu options that show and hide themselves according to the
prev. permissions of the user that logged in.
This needs to be shared across all pages in the site.
I thought that setting my @OutputCache directives to the following:
Directive="500"
VaryByControl="imgCustomer"
Shared="true"
would solve my difficulty.
However, in testing situtations, this is what happens:
Customer A logs in. Sees the header appropriate for Customer A. Header is
stored in cache.
Customer B logs in. Sees the header appropriate for Customer *A* (loaded
from cache).
Obviously, I want to cache each instance of the User Control that has a
different setting for imgCustomer.ImageUrl, such that Customer A will see
logo A, and customer B will see logo B. What have I done in error?
Any help would be *greatly* appreciated!
-Justice