views:

100

answers:

2

Hello,

I'm building a asp.net web application with lots and lots of controls and huge volumes of data. My application is very slow and it is taking a large amount of time to load the data into the .net controls like grid, tree view etc. I also have some ajaxified pages and controls in my application. I want to reduce the page load time in each postbacks.

What are the standards/best practices to be followed while developing large asp.net applications?

Thank you.

NLV

+2  A: 
  • Cache certain data, either in the application or in the database (thus breaking normalization but it's okay)

  • Retrieve the minimum subset of data you really need. Don't pull 10000 records from the database into a grid to only display 50. Query for exactly 50.

  • Mimimize the amount of server controls and dynamic markup creation. Replace what you can with passive HTML elements.

  • Switch off the view state, which can potentially expand pages to many megabytes in size. Pull the data from the database on each request (in combination with caching strategies).

Developer Art
The second point makes good sense with a datagrid. But what if i have a tree viewer control in place of a datagrid control? I have thousands of nodes in the control. Any ideas?
NLV
I believe you should only retrieve data for a node when it gets clicked to be expanded. Before that happens only load data for an upper hierarchy level. The subnodes get their data loaded on-demand (and again, only for their top-level hierarchy until their subnodes get clicked).
Developer Art
+1  A: 

You Can use JQuery to retreive the data from database which is much better than using ajax. Check this http://www.codeproject.com/KB/webservices/JsonWebServiceJQuery.aspx

Nila
So will that be fast than pulling the data using server side code?
NLV
S... Using updatepanels for dynamic loading will slow down the loading in my experience..
Nila