Slow Ajax postback - too much data?

Posted on 2008-11-18
Last Modified: 2013-11-07
This is complicated...

I have a repeater and in each item I have a table that contains an ImageButton.
When the ImageButton is clicked, I am using Ajax to populate another table within the appropriate repeateritem so that I can prompt the user for more information. This table-to-be-populated sits inside an UpdatePanel.

Here's the code for the updatepanel:

        <asp:UpdatePanel ID="upd1" runat="server" UpdateMode="Conditional">
        <asp:AsyncPostbackTrigger ControlID="imgBespoke" EventName="Click" />
            <asp:Table ID="rtbDetails" runat="server" CssClass="subtable"></asp:Table>

Clicking the imagebutton sets a hiddenfield in the relevant repeateritem to "y" and then causes a postback, and it's actually in Page_Load that I then loop through all repeateritems, looking for ones where the hiddenfield is set to "y". If so, I find the table-to-be-populated (rtbDetails) and then create and add the new cells, rows and fields (all 55 of them).
I do this in Page_Load because I need to maintain the ViewState of my dynamically created fields as I need to know what the user puts into them - by putting in Page_Load they are re-created each postback in the same way.

Believe it or not, it works! The table is populated with the dynamic fields, I can retrieve the values on postback and all is splendid. Until however I moved it to our on-line development server, and now there's a 10 seconds delay between clicking the ImageButton and Ajax doing its bit once there's more than about 80 rows in the repeater. As this only happens on the remote server, I presume the delay is a download of Ajax info that is then used to update the page.

Why is it sending so much? I thought it would only send the necessary code to update the relevant UpdatePanel?

Is there something I'm missing? Can I meaningfully track what is being sent back from the server without digging into packet sniffers etc, and more importantly, can I restrict it?

Incidentally, the reason I'm trying to do this is that if I pre-render all of the 55 fields per row and hide them, the whole page expectedly becomes slow to respond when there are many rows.

Any help very much appreciated.

ASP.NET 2, Win 2003.
Both IE 7 and Firefox
Question by:pskemp
    LVL 15

    Accepted Solution

    Fiddler ( is an excellent tool for debugging Ajax applications. Once installed you can run it from the tools menu in IE and it will show you how much data is being transferred and the contents.

    I have a suspicion that it could be viewstate causing the problem: for each updatepanel postback the viewstate is passed back and forth between server and client, if you have a lot of controls on there with viewstate enabled and a lot of rows it could add up to a large payload.

    Anyway, give fiddler a try and see what that tells you.
    LVL 1

    Author Comment

    Thanks NazoUK - I think you're right. I found a great article by Jeff Prosise ( which very nicely explains why an UpdatePanel in my situation is a bad idea. Even when I try and strip out as much viewstate as possible, there's still a lot left and I can't get it nearly quick enough.

    I've decided to do it all in javascript instead. Will also look into Fiddler.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    745 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

    19 Experts available now in Live!

    Get 1:1 Help Now