unnecessary calls of RenderContents of controls, which are not part of Ajax request

4 posts, 0 answers
  1. Khourshed Yakubov
    Khourshed Yakubov avatar
    6 posts
    Member since:
    Oct 2009

    Posted 26 Sep 2010 Link to this post

    Hi!
    I have about 10 ServerControls (MyOwn) on Page and one UserControl, which uses AjaxProxyManager and AjaxTimer.
    When timer raises ajax request, all page rerenders (it tries to render all 10 controls, which are not part of Ajax Request)
    I suppose I dont understand some of the basics of Ajax. Why it is needed to render all page (in my case it is very time-costly)?

    Could you advice me something to change in my solution?
    Can I arrange controls in such way when Ajax request renders only one control which I need to update?
  2. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 29 Sep 2010 Link to this post

    Hi Khourshed,

    To achieve your goal, you need to add an ajax setting where the timer control updates the one control you really want to be updated. Find more information on how to configure your RadAjaxmanager settings in the below online resources:

    http://www.telerik.com/help/aspnet-ajax/ajxajaxmanager.html
    http://demos.telerik.com/aspnet-ajax/ajax/examples/manager/firstlook/defaultcs.aspx

    Kind regards,
    Iana
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Khourshed Yakubov
    Khourshed Yakubov avatar
    6 posts
    Member since:
    Oct 2009

    Posted 29 Sep 2010 Link to this post

    Iana, let me show you my example:
    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="Timer1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="UpdatePanel"  LoadingPanelID="" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="UserNotificationView1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="UpdatePanel" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
    This part of code makes Postback request and Ajaxifies all fine, except the fact that after postback all RenderContents methods of all contros are invoked. If I have, say, 10 servercontrols on page i have 10 queiries to database, but in my case I need only one query, which is related to a control which needs to be rerendered. Visually it updates only one Control on client side, but make 10 queries on Server Side.

    I think I need to find out how XmlHttpPanel works, because it seems my solution close to that functionality.
  4. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 30 Sep 2010 Link to this post

    Hello Khourshed,

    What ajax does is to turn regular postbacks to callbacks and only part of the page content to be send/updated on the client. However the page lifecycle is executed the same way as with regular postbacks.

    Kind regards,
    Iana
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top