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

[Solved] How to programically register triggers for RadAjaxPanel

5 Answers 560 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Developer
Top achievements
Rank 1
Developer asked on 19 Mar 2008, 05:00 PM
I have a site in which there is a search box on the master page.  On every page except for the search results page, this control redirects to the search results page.  On the search results page, this control needs to do an asynchronous postback. 

This is easy to do with Ajax for .Net, you simply access the master page controls from the search results page and register the search button as a asynchronous trigger.  Unfortunately this page is now using the RadAjaxPanel, and I can't find an equivalent for how to register triggers with custom code.

Does anyone know how to do this?

5 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 20 Mar 2008, 07:28 AM
Hi,

Our RadAjax controls do not expose any triggers. Using RadAjaxPanel is straight forward as it is simply a self-contained/updated contained. If you want it to be updated from an outside control, this can be achieved by a custom clientside AjaxRequest() of the panel, however it would be more convenient to simply use RadAjaxManager and set the needed relations.

Best wishes,
Steve
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Developer
Top achievements
Rank 1
answered on 20 Mar 2008, 09:34 AM
So basically you still have triggers, they are just handled through another control instead of being direct properties of the update panel.  The RadAjaxManager only handles updates from controls outside the update panel whereas everything inside the panel automatically causes an asynchronous postback.

How do you handle the circumstance when you don't want every control inside the update panel to trigger an asynchronous postback?  Is there an option similar to the Conditional flag on a ASP .Net update panel?
0
Steve
Telerik team
answered on 20 Mar 2008, 11:32 AM
Hi,

Actually the RadAjaxManager can easily simulate RadAjaxPanel - take one asp:Panel, set it as initiator and updated control and this Panel would act as AjaxPanel.
As for the conditional disabling of ajax for specific controls - this is well documented in our help here.

Kind regards,
Steve
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Developer
Top achievements
Rank 1
answered on 20 Mar 2008, 12:58 PM
I hadn't thought of using the RadAjaxManager without any RadAjaxPanels, but this sounds like a much more intuitive way of building the page than having to implement your own postback function.  As a best practice Microsoft discourages writing your own calls to postback, as the syntax for this method could change with a future release or service pack of ASP .Net (which is why there is a method to generate this function for use when writing controls).  Since the control is coded into the function, this could get confusing if your page is at all complicated.

Using the RadAjaxManager and panels, you would basically be able to have much more granular control of what causes postbacks on your page, which is what I was looking for.
0
Steve
Telerik team
answered on 20 Mar 2008, 01:03 PM
Hi,

One thing I've forgot to mention is that Panel to Panel updates are not supported in Prometheus RadAjax. This is a limitation coming from the MS AJAX control we've built it on top of. MS AJAX does not allow a control to be registered through RegisterAsyncPostBackControl or RegisterPostBackControl if it does not implement either INamingContainer, IPostBackDataHandler, or IPostBackEventHandler, which of course asp:Panel do not implement. So you can make a single panel update itself without problems, but cannot have granular settings for Panel1 to update Panel2. In such cases simply set the separate controls you need from Panel1 to update Panel2 directly.

All the best,
Steve
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Ajax
Asked by
Developer
Top achievements
Rank 1
Answers by
Steve
Telerik team
Developer
Top achievements
Rank 1
Share this question
or