Skip to main content

Posts

Showing posts from 2017

Useful Asp.net Interview Question and Answer

1. What is the sequence in which ASP.NET events are processed? Below are the sequences in which the events occur: Page_Init Page load Control events Page unload event Page_init event only occurs when first time the page is started, but Page Load occurs in subsequent requests of the page. 2. In which event are the controls fully loaded? Page load event guarantees that all controls are fully loaded. Controls are also accessed in Page_Init events but ViewState is not fully loaded during this event. 3. How can we identify that the Page is postback? The Page object has an IsPostBack property which can be checked to know if the page was posted back or not. 4. How does ASP.NET maintain state in between subsequent requests? ASP.NET has multiple techniques for maintaining state between requests. The first one is ViewState where a hidden field is added to the form containing serialized data (so stored on the client) and deserialized on postback. This field cont...

Asp.net Data Caching

What is Caching? Caching is a technique of storing frequently used data/information in memory, so that, when the same data/information is needed next time, it could be directly retrieved from the memory instead of being generated by the application. Caching is extremely important for performance boosting in ASP.Net, as the pages and controls are dynamically generated here. It is especially important for data related transactions, as these are expensive in terms of response time. Caching in ASP.Net: ASP.Net provides the following different types of caching: Output Caching: Output cache stores a copy of the finally rendered HTML pages or part of pages sent to the client. When the next client requests for this page, instead of regenerating the page, a cached copy of the page is sent, thus saving time. Data Caching: Data caching means caching data from a data source. As long as the cache is not expired, a request for the data will be fulfilled from the...