Solved

Ajax or PageAsyncTask Asynchronous Loading of SQLDataSource Controls

Posted on 2010-09-02
4
1,215 Views
Last Modified: 2012-05-10
I have several pages that are now taking forever to load. I have been playing with using the RegisterAsyncTask approach, and while I can get the page to load with the SQLDataSources still churning away in the backgroud, I don't get a page refresh when they are done. I put the Async = True and set AsyncTimeout=1 in the page declaration, this is clearly the wrong way to do this.  Any advice on how to properly using Ajax or not deal with the loading of data.

This project is done using VB.Net 3.5
0
Comment
Question by:clintnash
  • 2
  • 2
4 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 33612542
How large are your pages?  How big is the ViewState?  Do you have a lot of SqlDataSource controls?
0
 
LVL 1

Author Comment

by:clintnash
ID: 33612795
The page has roughly 40 controls on it, about 12 are databound.  I am not sure how to answer the question as to how big is the viewstate and yes there are roughly 16 sqldatasource controls on the page.  The issue is with one sqldatasource control in particular.  It refreshes the data from a linked MySQL server into a table in the MySQL database.  When we tried to work directly from the linked server the performance was so bad the users refused to use the application.  So we preload now and the app performance is good, but as I said above the pages take forever to load and users are closing the browser because they think its not working.  I have made some progress on this using an updateprogress control, but I am curious if there is a better way to approach user notification of background processing.
0
 
LVL 1

Author Comment

by:clintnash
ID: 33612798
Sorry, error in my last comment, the line that read

from a linked MySQL server into a table in the MySQL database

Should have been

from a linked MySQL server into a table in the SQL database
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 33612984
There are different ways to approach this problem.  One way to look at the ViewState is to use a decoder, like Scott Guthrie describes here:

Cool Viewstate Decoder
http://weblogs.asp.net/scottgu/archive/2003/02/16/2495.aspx

"Light" reading about some possible solutions:

10 Tips for Writing High-Performance Web Applications
http://msdn.microsoft.com/en-us/magazine/cc163854.aspx

Page size can really reduce performance, and there are ways to look at reducing the page size:

How To Reduce Page Size In ASP.NET
http://www.beansoftware.com/ASP.NET-Tutorials/Reduce-Page-Size.aspx

Another approach to the ViewState is described here:

Determining an ASP.NET Page's View State Footprint
http://scottonwriting.net/sowblog/archive/2010/07/06/programmatically-determining-an-asp-net-page-s-view-state-footprint.aspx
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Combine two columns 3 38
Problem to Popup 37 81
crm written in asp.net / c# 1 42
Re-position the objects 7 52
I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now