In my default.aspx page I have many user controls and they take a lot of time to load. any one know how to make this page to be loaded faster.
-
please give more information how your page is built and about the performance bottlenecks. – slfan Apr 11 '11 at 22:24
3 Answers
Be sure to only load the information you need to display on the page on the initial load. Any subsequent information should be loaded via a postback or ajax.
A few days ago somebody asked somewhat similar i tried to answer:
Panel and User Controls vs load User Controls dynamically
Summary:
You should lazy-load your UserControls if you have them all in page but only single UserControls visible. That means:
Do nothing in the UserControl's Page_Load but only when the controller(page) makes it visible. Therefore expose functions to load their data and update their inner UpdatePanels in the ascx. Then - after the function was called from the page and the control was made visible - let the page update the outer UpdatePanel around the UserControl(s).
On this way the usercontrols will neither be rendered nor databound before they have been made visible and you can always simply reference them directly.
Let them communicate in the following ways:
- Page > UserControl via Functions/Properties
- UserControl > Page via Events

- 1
- 1

- 450,073
- 74
- 686
- 939
Because the default page is loaded very often, you could try output cache to improve the performance of your site. You can use it for the whole page or for the user controls that take the longest to load. Just put the following tag on the top of your page
<%@ OutputCache Duration="300" VaryByParam="none" %>
Duration is the time in seconds the page stays in cache.
To improve the performance of your site you should first analyze the bottlenecks and provide us with more information. There are many possiblities for performance improvements.

- 8,950
- 115
- 65
- 78