I have a controller action that receives a complex object as a parameter, I need the OutputCache to vary by one of the properties of this complex object. Is this possible? How?
相关问题
- Entity Framework throws exception - Network Relate
- Slow loading first page - ASP.NET MVC
- How to do an inline style with asp.net mvc 3 razor
- How to access the System.ComponentModel.DataAnnota
- Validation Attribute get triggered two times
相关文章
- “Dynamic operations can only be performed in homog
- Change color of bars depending on value in Highcha
- How to get server path of physical path ?
- How to find the exceptions / errors when TryUpdate
- ASP.Net MVC 3: optgroup support in Html.DropDownLi
- A circular reference was detected while serializin
- AccessViolationException was unhandled
- How to hide miniprofiler?
if you have a model like
and in the (strongly typed)view you have a form
and you submit the form to an
ActionResult
savePerson, with varying signature likeor
therefore i think if you annotate the ActionResult like
it will do for you, or if you have a complex model like
try
I had the same requirement as above and came up with a slightly different approach
The class
OutputCacheComplexAttribute
Attribute usage
with this new attribute, you can specify which type[s] to use for caching and the cache key will be computed based on values of each its properties.
For object, just that work fine: