Substitution Web Server Control
in ASP.NET environment,This article explains you how to work with Substitution Web Control.The Substitution control specifies a section on an output-cached Web page that is exempt from caching. Use the Substitution control to specify a section on an output-cached Web page where you want dynamic content substituted for the control.
Dynamically Updating Portions of a Cached Page
in a Web application environment,the output of the page is cached if an ASP.NET page is cached. On the first request, the page runs and caches its output. On subsequent requests, the request is fulfilled from the cache and code on the page does not run.
You can use the Substitution control to insert dynamic content into the cached page. The Substitution control does not render any markup.he method called by the Substitution control must meet the following criteria:
- It is defined as a static method
- It accepts a parameter of type HttpContext.
- It returns a value of type String.
Note that other controls on the page are not accessible to the Substitution control—that is, you cannot examine or change the value of other controls. However, the code does have access to the current page context using the parameter passed to it.
the following code snippets demonstrates the above purposes.