Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET database , +
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
Edited 3-Sep-12 10:16am
v2
Comments
virang_21 at 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
good
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.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Hi,
 
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,
Thanks
-Amit Gajjar
  Permalink  

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

  Print Answers RSS
0 CPallini 550
1 Sergey Alexandrovich Kryukov 405
2 George Jonsson 288
3 Pheonyx 218
4 OriginalGriff 200
0 OriginalGriff 4,813
1 CPallini 3,890
2 Sergey Alexandrovich Kryukov 3,274
3 George Jonsson 2,552
4 Gihan Liyanage 2,186


Advertise | Privacy | Mobile
Web02 | 2.8.140905.1 | Last Updated 3 Sep 2012
Copyright © CodeProject, 1999-2014
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