Post cache substitution, DOT NET Programming

What is Post Cache substitution?

The Post cache substitution is used when we want to cache the complete page but also require some of the dynamic region inside that cached page. Some examples such as RandomPhotos, QuoteoftheDay, and AdRotator etc.  Where we can implement the Post Cache Substitution.

Post-cache substitution can be achieved by 2 means:

1) Call the new Response.WriteSubstitution process, passing it a reference to the desired substitution method callback.

2) Add a control to the page from  the desired location, and fixed  its methodName attribute to the name of the callback method.

816_post cache substitution.png

Figure: - "Writesubstitution" in action

We have "GetDateToString()" a static function  . We pass the response substitution callback to the "WriteSubstitution" process. So now when ASP.NET page framework retrieves the cached page, it automatically triggers your callback process to get the dynamic content. Now it inserts your content into the cached HTML of the page. Even if your page hasn't been cached yet (for example, it's being rendered for the first time), ASP.NET still calls your callback into the same way to get the dynamic content. So you create a process which generates some dynamic content, and by doing so you assure  that your process is always called, and it's content is never cached.

The example above was by using "WriteSubstitution" now lets try to see how we can do by using "" control. You can get the "" control from the editor toolbox.

75_post cache substitution1.png

Figure: - Substitution Control

1735_post cache substitution2.png

Figure: - Substitution in Action

Posted Date: 9/21/2012 9:09:11 AM | Location : United States







Related Discussions:- Post cache substitution, Assignment Help, Ask Question on Post cache substitution, Get Answer, Expert's Help, Post cache substitution Discussions

Write discussion on Post cache substitution
Your posts are moderated
Related Questions
how to write a postfix expression calculator program using c#

Project Description: I require a C# Console project written to simply enter an Origin and Destination/Date on the United Airlines Site, from the returned page select and return

What is a Manifest?  An assembly manifest have all the metadata needed to specify the assembly's version requirements and security identity, and all metadata required to define

What is the use of data adapter? The Data adapter are the objects that connect one or more Command objects to a Dataset object. They give logic that would get data from the dat

How can you use Hidden frames to cache client data? This technique is implemented by developing a Hidden frame in page which will have your data to be cached. T cols="100

What is XPath? XPath stands for XML Path. It is a language used to access dissimilar parts of an XML document, such as elements and attributes.

Project Description: Online game development 1. Online Live Baccarat Game is required - server program(IOCP or ect..). - 2D graphic design. - client program. - we

What is a class? A class explains all the attributes of objects, as well as the methods that execute the behavior of member objects. It is a comprehensive data type, which show

concept of strong names Strong name is similar to GUID(It is supposed to be unique in space and time) in the COM components.Strong Name is only needed when we need to deploy as

What is Multi-tasking? It is a feature of the modern operating system with which we can run multiple programs at the same time for example Word, Excel etc.