Created
September 10, 2014 00:01
-
-
Save Shazwazza/931885e682b8fe34220e to your computer and use it in GitHub Desktop.
CachedPartial with contextualKeyBuilder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Html.CachedPartial( | |
//partial view name | |
"myPartialView", | |
//the model to pass the view - this will be the same object passed to the contextualKeyBuilder delegate | |
Model, | |
//seconds to cache | |
123, | |
//the key builder delegate, accepts the model passed in to the cached partial and the current | |
// viewdata dictionary of the partial view | |
contextualKeyBuilder: (model, viewdata) => | |
"some key, you can use the model and viewdata data to build the key if you want") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment