ASP.NET Page Load Time

Hi,

I have a ASP.NET web application that uses Microsoft Silverlight. The issue that I have is that it takes a long time to load the page up (5 to 10 mins). I run this in debug mode so I know this will be slower than running the appilcation without debbuging, however even that method is still very slow. I have written some code in C# to retrieve some data from a Access database.

In the "Page Load" method I put a break point at the last line & when executing the code it gets there extremely quick, it just seems to take ages to load for what reason I do not know.

If anyone has any ideas that would be great.

Thanks
mcs26Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
When determining page loading problems, the first place that I would look is the pay load.  How big is the page request?  Is there a lot of view state (this is Base-64 encoded UTF-16 XML, and can be very large)?

Taking a Bite Out of ASP.NET ViewState
http://msdn.microsoft.com/en-us/library/ms972427.aspx
0
mcs26Author Commented:
Hi LearnedOne,

Thanks for the reply. This is my first ASP.Net web application so I do not know where or how to find the pay load?

The page loads a chart which is a third party control from dotNetCharting. It uses Microsoft Silverlight & basically the code I have written is just transfering currency prices from an access database to the chart.

Thanks again,

Mark
0
Bob LearnedCommented:
Mark,

You can determine page state size programmatically:

http://www.velocityreviews.com/forums/t71625-how-to-programmatically-determine-page-and-viewstate-size.html
using System.Web.UI;
using System.IO;

...


        protected override void SavePageStateToPersistenceMedium(object viewState)
        {
            // To calculate view state size:

            base.SavePageStateToPersistenceMedium(viewState);

            LosFormatter format = new LosFormatter();

            StringWriter writer = new StringWriter();

            format.Serialize(writer, viewState);

            int viewStateLength = writer.ToString().Length;
        }

        protected override void Render(HtmlTextWriter writer)
        {
            // To Calculate page size :
            StringWriter customWriter = new StringWriter();

            HtmlTextWriter localWriter = new HtmlTextWriter(customWriter);

            base.Render(localWriter);

            int pageLength = customWriter.ToString().Length;

            writer.Write(customWriter.ToString());
        }

Open in new window

0
mcs26Author Commented:
Should this code be put in the pageload event? Also where will I see the output?

Cheers
0
Bob LearnedCommented:
That goes in an .aspx page.  It might not work for Silverlight, and I don't have any experience with Silverlight.  There are different approaches in an ASP.NET web page, such as a Label, or outputting to a file.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.