Click here to Skip to main content
13,143,774 members (27,892 online)
Rate this:
Please Sign up or sign in to vote.
See more: , +
I am building an Asp.Net application and wander if it's a sort of important to load a heavy page's content using multithreading. Let suppose we have a certain page that contains three main methods in its load_page method, and that those three methods perform logic and heavy operations such as database access and some other operations that may delay a little. So, should those three methods be implemented in different threads or I should just let them in the page load method to be executed? I really want the page's loading not to interfere with these heavy operations. What should I do? and what will I gain from separating these methods from the main page load's thread.
Looking forward to hearing from you.
Posted 3-Sep-12 10:13am
Updated 3-Sep-12 10:16am
virang_21 3-Sep-12 20:14pm
If database operation to display some information you don't need to load all the data .. just select only number of records that you want to show on that page... it is always better to select top 100 records then selecting say 100000 records and displaying just 100 of them... implement lazy loading ... Avoide any resource intensive calculations / operations in page load if you can...
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You're thinking about it a little backwards. The page load will not affect those "heavy operations" at all. It's the heavy operations that will affect the page loading.

Since the content is generating what is viewed on the page (I'm assuming!) the user won't see the page until those operations are done.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2


I prefer to read about Asynchronous method calling.

Please read MSDN : Async Method call in ASP.NET[^]

In web application, you really need to look into optimization of your time consuming methods. You need to design your UI very smartly so page load will not take more time. you can use Paging/Tabs/PopUp pages/Dialog box. Do not load everything in one go.

There should not be any timeconsuming method except Calling Web method/Calling remote database/ Heavy UI. (And even this should be optimize)

Hope this information helps you,
-Amit Gajjar

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.170915.1 | Last Updated 3 Sep 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100