Is there a way to disable asp.net caching on selected page. It would be nice if this can be done from the web.config.
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Carriage Return (ASCII chr 13) is missing from tex
- Generic Generics in Managed C++
- Why am I getting UnauthorizedAccessException on th
Or
Unfortunately, it has to be done within the page. There's no easy way to do it from web.config. For more information, check out:
MSDN - Setting the Cacheability of a Page
Yes you can if you are willing to create your own config section: http://msdn.microsoft.com/en-us/library/2tw134k3.aspx
In your config section put something like,
You could add more properties such as duration if you like.
Then, on the page_Init method of your pages, check this configuration section and call the following where appropriate:
Edit: Tip: Put the init code in a base class that your pages inherit, so that it is only one place.