Question

I am looking for a way to speed up post backs in asp.net. My issue here is that I have a decent amount of items displayed in a telerik RadGrid (a few hundred or so). Each of these items has a detail table. Each parent item and its items in its detail table have checkboxes. When the parent item's checkbox is clicked, it performs a postback and checks or unchecks all of its detail table's items. When I do this, I'm getting about a 1-2 second delay.

A couple limitations:

-Has to be performed server-side: My customer would prefer to keep client-side scripting at a minimum.
-Paging is not an option

There are only a couple things I can think of that would cause a performance hit:

-ViewState size: Although I'm not explicitly storing any values in the viewstate, I think my main issue is the number of items I'm displaying in my grid.
-Hits to the database: When the postback is performed, (aside from membership queries and other business logic) there are no additional calls to the database.

What other options do I have to speed up my postbacks?

EDIT

I forgot to mention that all of my controls are already ajaxified using Telerik's RadAjaxManagerProxy. I have them wrapped in a Panel called pnlContainer, and I'm doing the following:

<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="pnlContainer">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="pnlContainer" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>

Maybe there's a better approach?

Was it helpful?

Solution

You can try the following items if you have a big postback happening:

  • If you have deep control hierarchy (many levels of controls) your IDs will take up a lot of space since each child control's ID is a concatenation of all its parents. Therefore your control IDs should be as small as possible.

  • When not necessary, dont use .NET controls. For example, if you have a static label, dont use asp:Label but plain SPAN tag.

  • Use UpdatePanels with ChildrenAsTriggers=true and UpdateMode=Conditional

  • Minify your javascript and CSS files.

  • Disable viewstate on items that dont need it.

  • Enable compression on web server

OTHER TIPS

Try UpdatePanels. You can post back only part of the page that needs it, instead of reprocessing the whole page.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top