I have a page with a usercontrol on (MyUserControl). MyUserControl is able to raise a "custom" event which is handled by the page code-behind.
Both MyUserControl and page have RadAjaxManagerProxy controls (the main page is controlled by a master page.)
Here is the process:
MyUserControl initiates an ajaxrequest through client-side script:
This is then dealt with by MyUserControl in its code behind.
For info, the RaiseSaved sub call is for raising the MyUserControl OnUpdated event. The Refresh() sub call just refreshes controls in MyUserControl.
The event is then handled by the code behind in the main page:
The event is definitely firing as the "MyUserControl.Visible = False" statement hides MyUserControl.
However, the control on the main page (RebindStatus) is not being updated and this is the problem. I need to be able to update this (and any other) control on the main page.
For info, RebindStatus is another usercontrol which has a custom property that updates a label in the RebindStatus control.
I have probably got the Ajax settings incorrect. For the RadAjaxManagerProxy on MyUserControl:
NB. MasterPageAjaxManager is the name of the RadAjaxManager on the MasterPage controlling the main page.
For the RadAjaxManagerProxy on the main page:
How can I update the RebindStatus control from the event raised by MyUserControl? To confirm, the OnUpdated event is firing, but no controls on the main page can be updated from this event.
thanks
Graham.
Both MyUserControl and page have RadAjaxManagerProxy controls (the main page is controlled by a master page.)
Here is the process:
MyUserControl initiates an ajaxrequest through client-side script:
function Refresh() { |
$find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest('Refresh'); |
} |
This is then dealt with by MyUserControl in its code behind.
Private Sub Control_Load(ByVal Sender As Object, ByVal e As EventArgs) Handles MyBase.Load |
Dim Manager As RadAjaxManager = RadAjaxManager.GetCurrent(Page) |
AddHandler Manager.AjaxRequest, AddressOf AjaxManager_AjaxRequest |
End Sub |
Protected Sub AjaxManager_AjaxRequest(ByVal sender As Object, ByVal e As AjaxRequestEventArgs) |
Select Case e.Argument.ToString() |
Case "Refresh" |
RaiseSaved() |
Refresh() |
End Select |
End Sub |
For info, the RaiseSaved sub call is for raising the MyUserControl OnUpdated event. The Refresh() sub call just refreshes controls in MyUserControl.
The event is then handled by the code behind in the main page:
Public Sub MyUserControl_Updated(ByVal Sender As Object, ByVal e As EditorUpdatedEventArgs) Handles MyUserControl.OnUpdated |
'Check to see if event is being handled/firing |
MyUserControl.Visible = False |
'Update a control on the main page |
RebindStatus.RebindStatus = True |
End Sub |
The event is definitely firing as the "MyUserControl.Visible = False" statement hides MyUserControl.
However, the control on the main page (RebindStatus) is not being updated and this is the problem. I need to be able to update this (and any other) control on the main page.
For info, RebindStatus is another usercontrol which has a custom property that updates a label in the RebindStatus control.
I have probably got the Ajax settings incorrect. For the RadAjaxManagerProxy on MyUserControl:
<telerik:RadAjaxManagerProxy ID="WindowAjaxManagerProxy" runat="server"> |
<AjaxSettings> |
<telerik:AjaxSetting AjaxControlID="MasterPageAjaxManager"> |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="MyUserControl" /> |
<telerik:AjaxUpdatedControl ControlID="RebindStatus" /> |
</UpdatedControls> |
</telerik:AjaxSetting> |
</UpdatedControls> |
</AjaxSettings> |
</telerik:RadAjaxManagerProxy> |
For the RadAjaxManagerProxy on the main page:
<telerik:RadAjaxManagerProxy ID="WindowAjaxManagerProxy" runat="server"> |
<AjaxSettings> |
<telerik:AjaxSetting AjaxControlID="MyUserControl" EventName="OnUpdated"> |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="RebindStatus" /> |
</UpdatedControls> |
</telerik:AjaxSetting> |
<telerik:AjaxSetting AjaxControlID="MyUserControl"> |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="MyUserControl" /> |
<telerik:AjaxUpdatedControl ControlID="RebindStatus" /> |
<telerik:AjaxUpdatedControl ControlID="MainPageAjaxManager" /> |
</UpdatedControls> |
</telerik:AjaxSetting> |
<telerik:AjaxSetting AjaxControlID="MainPageAjaxManager"> |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="BookingEditor" /> |
<telerik:AjaxUpdatedControl ControlID="MainPageAjaxManager" /> |
<telerik:AjaxUpdatedControl ControlID="RebindStatus" /> |
</UpdatedControls> |
</telerik:AjaxSetting> |
<telerik:AjaxSetting AjaxControlID="RebindStatus"> |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="RebindStatus" /> |
</UpdatedControls> |
</telerik:AjaxSetting> |
</AjaxSettings> |
</telerik:RadAjaxManagerProxy> |
How can I update the RebindStatus control from the event raised by MyUserControl? To confirm, the OnUpdated event is firing, but no controls on the main page can be updated from this event.
thanks
Graham.