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

[Solved] Using RadAjaxManager in Composite Server Control

4 Answers 148 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Cyber High
Top achievements
Rank 1
Cyber High asked on 03 Jun 2008, 04:29 PM
I have a composite server control that I built using the previous version of the Rad Controls. It has an AjaxManager in it, that is created in the CreateChildControls event. My problem is that I get an "Object reference not set to an instance of an object" error, whenever I try to add ajax settings to the AjaxManager. I have tried doing so in the CreateChildControls event (where I did it with the previous version of RadControls) and in the PreRender. Both places return the same error.

How can I use the new AjaxManager in a composite server control and add ajax settings to it?

4 Answers, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 04 Jun 2008, 01:15 PM
Hi Guido Prambs,

Please review the following online help resources on how to update in composite controls and add ajax setting programmatically:

http://www.telerik.com/help/aspnet-ajax/ajxupdateincompositecontrol.html
http://www.telerik.com/help/aspnet-ajax/ajxaddajaxsettingsprogrammatically.html

Let us know if you need further assistance.

Regards,
Iana
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Cyber High
Top achievements
Rank 1
answered on 04 Jun 2008, 09:09 PM
Is there no way to include the AjaxManager in the Composite Control rather than passing a reference to one that exists on the page? This is not really the solution I was looking for.

I need to associate an AjaxRequest event with the AjaxManager. So if I am just passing a reference to an AjaxManager on the page, would I still be able to define the AjaxRequest event in the composite control, or would I have to add it to each calling page individually? And if it is possible to define the AjaxRequest in the composite control, then what do I do if the page's AjaxManager already has its own AjaxRequest event?
0
Accepted
Iana Tsolova
Telerik team
answered on 05 Jun 2008, 11:33 AM
Hi Guido,

You could add the RadAjaxManager directly in your composite control. I suggest that you add it on Init event handler of the control. Also you need to intercept the page's PreRender event in order to define the AjaxSettings there. For you convenience I have prepared a sample attached to this post.

Regarding your question about the AjaxRequest event:
You can implement one event handler of it on the page and one in the user control, and both handlers will be executed consequently without interfering with each-other.

Kind regards,
Iana
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Cyber High
Top achievements
Rank 1
answered on 05 Jun 2008, 04:01 PM
Thank you. This seems to work well with the testing I have done so far.
Tags
Ajax
Asked by
Cyber High
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Cyber High
Top achievements
Rank 1
Share this question
or