Substitution control to bypass cache

When OutputCache is used to cache the page, the page response will be cached and the cached pages will be shown till the cache expires. This allows the web page to be rendered quickly. Wait there is a possibility that a frequently updated data is not shown to the client because of the cache. If this is what we want to accomplish, then substitution control can actually bypass the cache and display the frequently updated content to the client even thought he entire page is cached.

Display Data Using Substitution Control

To display some data using this control we need to have a static method accessible from mark-up. This function should accept a parameter with the type HttpContext, So that the control can fetch the data using this method.

How to verify the Substitution Control works?

If the sample doesn’t have a Cache directive, it is hard / impossible to notice how the control is actually bypassing the cache, so ...

02-Mar-2010

DataBinding WPF Menu with Dataset

For a complete working application Menu is a best known choice for navigation. Whatever other navigations such as toolbar, tabs etc... are optional and will add value for the application . It is a great control to display hierarchically organized data.  One of the basic thing to be noted is we need to use HierarchicalDataTemplate for loading hierarchical data.

HierarchicalDataTemplate in mapping data

For WPF Menu to understand the hierarchy of the data, we need to define releationships in the HierarchicalDataTemplate. It will work ONLY if the dataset given is the Relational Database with proper relationships added. And give a name that describes the relationships well (for readability). Add a TextBlock for displaying the header table information. In this article we refer categories as the Header. Remember to provide a unique Key for the object also.

ItemsSource in Hierar ...

Read more here:   WPF Menu Databinding 

01-Mar-2010





Spam Bot Trap