Tip #22: Did you know…How to improve performance of Page and Server Control Processing?

  1. Avoid unnecessary round trips to the server - You can use ASP.NET Ajax and partial page rendering.

    ASP.NET Ajax - ASP.NET  Ajax allows the developer to create web application in ASP.NET which can update data on the web page without a complete reload of the page.

    Partial Page Rendering - Partial-page rendering relies on server controls in ASP.NET and on client functions in the Microsoft AJAX Library. You do not have to use the Microsoft AJAX Library to enable partial-page rendering, because this functionality is provided automatically when you use the ASP.NET AJAX server controls. However, you can use the APIs exposed in the client library for additional AJAX functionality. ASP.NET enables you to add partial-page rendering to new or existing ASP.NET Web pages without writing client script.

    To get more information, see partial page rendering overview and  ASP.Net Ajax.

  2. Use the Page object's IsPostBack property to avoid unnecessary processing

  3. Leave buffering on unless you have a specific reason to turn it off

Please take a look at Chapter 6 - Improving ASP.NET performance to learn more about best practices.

 

Thanks
Deepak Verma
SDET | Visual Web Developer