Reputation: 21
I am passing the viewdata from base controller. Every controller is inherited from that controller class.
viewdata["currentuser"] is different for every kind of user.
How I can cached it differently for every different value of currentuser in viewdata.
Someone show me code through the ACtionfilter.
What I have tried ?
I tried to add the cache through the this.httpcontext but it didn't return the viewdata back to me when I do this inside the controller action.
I still stuck with the code that I can put on filter to cache the stuff.
Upvotes: 0
Views: 97
Reputation: 21
What I am trying to do is serve different-different html response to every registered user. all guest user will got same response (guest user Id = 0 in all cases).
Outputcache is little bit hard. Because I need to check the current user before cache it.
Simply I do system.web.caching.insert this trick fix my problem.
Upvotes: 0