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

Retain ajaxsettings after ajaxpost

5 Answers 36 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Wim van der Linden
Top achievements
Rank 1
Wim van der Linden asked on 05 Oct 2009, 09:53 PM
Dear telerik,

I got a case where I load multiple usercontrols of the same type with different data.
Any control can trigger a postback in which I only wish to update that specific control.

I see that I can find the initiating control ID in the RadScriptmanager.
This allows me to update only the value I wish to update. That even seems to work very good.

However all controls that were previously ajaxified are no longer ajaxified.
I assume this happens because the AjaxManager gets reinitialized?

But even when I do reset the ajaxmanagers ajax settings it won't work. 
Does it depend on the viewstate or something like that?

and as a final question:
are there any suggestion on how to get this particular behaviour since executing all
code in the codebehind seems rather useless(and most importantly slow compared to doing this with a custom XMLHttpRequest).
It makes the ajaxmanager kinda useless to me if there is no other way.

I really hope you guys can help me with this.

kind regards,
Wim 

5 Answers, 1 is accepted

Sort by
0
Wim van der Linden
Top achievements
Rank 1
answered on 06 Oct 2009, 10:09 AM
As a followup.
in older controls there seemed to be an event called OnResolveUpdatedControls.
In de code library I found something usefull however this event does not seem to exist anymore?!?

what is the current equivelent of this event?

in this post an example is given for using the AjaxSetting created event.
http://www.telerik.com/community/forums/aspnet-ajax/ajax/updating-different-control-with-ajax.aspx
I don't really see how that can help me since all my ajaxsettings are created properly on first load,
but lost, because I don't reload my controls expect for the one that triggerd the ajax event.

Resetting the ajaxsettings without reloading the controls does not seem to do anything (the control ID's match and the updatepanels are in markup after the post, this has been checked with the developer tools not the default view source since that won't update after ajax updates).

kind regards,
Wim
0
Iana Tsolova
Telerik team
answered on 08 Oct 2009, 11:01 AM
Hi,

Firstly I suggest that you check out this help topic for more information on loading user controls with ajax.
Secondly, I need to mention that ajax does turns the postbacks into calbacks. However, it does not affect the page lifecycle. All events and methods are called, and in the same sequence, as in regular postbacks. The main difference is that only particular part of the page html is rendered back on the client.

Regarding the OnResolveUpdatedControls event: I am afraid it is removed from RadAjax for ASP.NET AJAX contro implementation.

As it is to the ajax settings: If you are adding ajax setting programatically, you need to add them on each page load. Please note that in this case, you need to be sure the controls taking part in the ajax setting pair are already available on the page.

Check it out and let me know how it goes.

Kind regards,
Iana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Wim van der Linden
Top achievements
Rank 1
answered on 08 Oct 2009, 02:32 PM
Hi Iana,

I do understand the working of the both the loading of controls and the callbacks ( I just keep calling them postbacks for old times sake I guess ...). But my point is that when I update only a small part of my page, the time needed to rebuild everything else in codebehind seems kinda useless. So I divided my code into pieces so the program can easily decide how to rebuild the page.
In other words I do not recreate anything in code behind that will not be updated on the client.

Anyway I implemented these usercontrols a while back and everything works fine that's not the issue.
However the greater the number of controls the more time the callback takes (kinda obvious I know).

That is why I've been searching for a way to reload a single control and reset it's ajaxsetting.
I even tried to store the old ones in session and rebind it to the ajaxmanager (since the ID's still exist in the client page source).
But somehow these ID's do not get matched after the callback.
I was thinking this is maybe something like a serverside check if the ID's exist?!?

Everything works fine on first callback, a single control gets reloaded and stays ajaxified (So I can keep repeating the callback), making the callback really fast. But all other controls just don't have it registered anymore.

So as in your last suggesting, I am 100% sure that the control ID's I add to the ajaxmanager are available on the page.
But I do not reload the controls in codebehind. I just remember the keys I added and re-add them to the ajaxmanager on callback.
I tried both the original Settings collection and basic string keys.

Any idea's would be well appreciated,
however I do know that when using the ms ajax update panels the behaviour appears to be the same.

Kind regards,
Wim
0
Iana Tsolova
Telerik team
answered on 12 Oct 2009, 09:27 AM
Hi,

I suggest that you open a formal support ticket and send us a runnable application illustrating your scenario and issues you are facing. Thus we could get a better idea of what you are trying to achieve, debug the sample locally in order to find the cause of the problem and turn back to you with a proper solution.

Thank you for your cooperation in advance.

Best wishes,
Iana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Wim van der Linden
Top achievements
Rank 1
answered on 13 Oct 2009, 01:17 PM
Hi,

I guess I've been trying to achieve this with the wrong control.
It appears that the XmlHttpPanel contains the functionalities that I require.
I was not aware of the fact that it now also works well with the other RadControls.

So I guess my problem does not exist anymore.

Thanks for your time,

Wim
Tags
Ajax
Asked by
Wim van der Linden
Top achievements
Rank 1
Answers by
Wim van der Linden
Top achievements
Rank 1
Iana Tsolova
Telerik team
Share this question
or