This is a migrated thread and some comments may be shown as answers.

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

3 Answers 54 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Khourshed Yakubov
Top achievements
Rank 1
Khourshed Yakubov asked on 26 Sep 2010, 06:57 PM
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?

3 Answers, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 29 Sep 2010, 01:41 PM
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
0
Khourshed Yakubov
Top achievements
Rank 1
answered on 29 Sep 2010, 09:41 PM
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.
0
Iana Tsolova
Telerik team
answered on 30 Sep 2010, 11:02 AM
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
Tags
Ajax
Asked by
Khourshed Yakubov
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Khourshed Yakubov
Top achievements
Rank 1
Share this question
or