We are moving from the ASP.NET standard RAD controls to use the Prometheus controls, and are having a problem with one scenario. We have a application using master pages, and are using the RadAjaxManager in the master page with RadAjaxManagerProxy controls in the content pages.
In one particular instance we require the use of a RAD toolbar to call a Javascript function which in turn creates an ajax request throuhh the client side API.
We are having problems getting this to work. Previously we we using the AjaxRequest method from the client side API and using the AjaxControlId to be that of the manager, however this does not seem to work when used with a RadAjaxManagerProxy. Is there an equivalent method or a known workaround?
We've tried looking through the available documentation but cant find any mentions of a client side API for the RadAjaxManagerProxy control.
Thanks
In one particular instance we require the use of a RAD toolbar to call a Javascript function which in turn creates an ajax request throuhh the client side API.
We are having problems getting this to work. Previously we we using the AjaxRequest method from the client side API and using the AjaxControlId to be that of the manager, however this does not seem to work when used with a RadAjaxManagerProxy. Is there an equivalent method or a known workaround?
We've tried looking through the available documentation but cant find any mentions of a client side API for the RadAjaxManagerProxy control.
Thanks
10 Answers, 1 is accepted
0

Leon
Top achievements
Rank 1
answered on 24 Sep 2007, 10:24 AM
That has been discussed some time ago here in the forum. Find the link below:
http://www.telerik.com/community/forums/thread/b311D-ththc.aspx
I hope this helps.
http://www.telerik.com/community/forums/thread/b311D-ththc.aspx
I hope this helps.
0

Rob
Top achievements
Rank 1
answered on 24 Sep 2007, 10:43 AM
I cant see anything in that thread that helps in this instance, as my problem is initialising an ajax request from within a child control which contains a RadAjaxManagerProxy.
There are comments that touch on similar matters, but no solution that I can see.
There are comments that touch on similar matters, but no solution that I can see.
0

Leon
Top achievements
Rank 1
answered on 24 Sep 2007, 10:52 AM
Perhaps you can get the client object of the RadAjaxManager instance via GetCurrent() method as in the thread I referred to and call its AjaxRequest? I'd give that a go.
0

Rob
Top achievements
Rank 1
answered on 24 Sep 2007, 10:57 AM
Ive already tried by exposing a RadAjaxManager as a property which returns the control from the master page. I can call the method successfully, its actually updating the controls on the page that don't seem to work.
Ive tried programmatically adding ajax settings, but am unsure which controls to include as the arguments. Should it be the manager on the master page? the proxy object? The rad code block? I cant successfull y get the controls to update once the request is completed.
Ive tried programmatically adding ajax settings, but am unsure which controls to include as the arguments. Should it be the manager on the master page? the proxy object? The rad code block? I cant successfull y get the controls to update once the request is completed.
0

Leon
Top achievements
Rank 1
answered on 24 Sep 2007, 11:07 AM
I believe the manager should be set as it is the one that initiates the AJAX request. You need to set the one which you want to update as updated control:
MyManager.AjaxSettings.AddAjaxSetting(MyManager, ControlToUpdate)
That won't work in each case, though. You should add those settings dynamically on each page load - those are not preserved in the ViewState.
MyManager.AjaxSettings.AddAjaxSetting(MyManager, ControlToUpdate)
That won't work in each case, though. You should add those settings dynamically on each page load - those are not preserved in the ViewState.
0

Rob
Top achievements
Rank 1
answered on 24 Sep 2007, 11:17 AM
Have already given that a go but to no avail. Thanks for the help so far.
0
Hello rrrr,
Can you please send the problematic application through support ticket? We will debug the issue locally and find resolution to the problem. Please, make sure we can compile that or just create a sample replicating this issue.
Thank you in advance and looking forward to hearing from you.
All the best,
Konstantin Petkov
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Can you please send the problematic application through support ticket? We will debug the issue locally and find resolution to the problem. Please, make sure we can compile that or just create a sample replicating this issue.
Thank you in advance and looking forward to hearing from you.
All the best,
Konstantin Petkov
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0

Rob
Top achievements
Rank 1
answered on 25 Sep 2007, 08:18 AM
Ive uploaded the test project to my personal webspace
[Link Removed]
Any help appreciated, either in whether the implementation is incorrect, or resolving any possible bugs.
[Link Removed]
Any help appreciated, either in whether the implementation is incorrect, or resolving any possible bugs.
0
Hi rrrr,
Well, its almost ready! You just need to modify the button OnClientClick this way: OnClientClick="btnClick(); return false;" so that the button won't postback after sending an AJAX request. I'm posting the complete working code for anyone else who experience difficulties in a similar scenario:
UserControl Markup:
UserControl code-behind:
Note that you don't need the proxy at all in this simple case.
Regards,
Konstantin Petkov
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Well, its almost ready! You just need to modify the button OnClientClick this way: OnClientClick="btnClick(); return false;" so that the button won't postback after sending an AJAX request. I'm posting the complete working code for anyone else who experience difficulties in a similar scenario:
UserControl Markup:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl1.ascx.cs" Inherits="Ajax_Testing.WebUserControl1" %> |
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
<asp:Button ID="Button2" runat="server" Text="Button2" OnClientClick="btnClick(); return false;" /><br /> |
<asp:Label ID="Label2" runat="server" Text="Label2" /> |
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> |
<script type="text/javascript"> |
function btnClick(){ |
var ajaxManager = <%=Manager.ClientID%>; |
ajaxManager.AjaxRequest(''); |
} |
</script> |
</telerik:RadCodeBlock> |
UserControl code-behind:
public partial class WebUserControl1 : System.Web.UI.UserControl |
{ |
public RadAjaxManager Manager |
{ |
get { return RadAjaxManager.GetCurrent(Page); } |
} |
protected void Page_Load(object sender, EventArgs e) |
{ |
Manager.AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(WebUserControl1_AjaxRequest); |
Manager.AjaxSettings.AddAjaxSetting(Manager, Label2); |
} |
protected void WebUserControl1_AjaxRequest(object sender, AjaxRequestEventArgs e) |
{ |
Label2.Text = DateTime.Now.ToLongTimeString(); |
} |
} |
Note that you don't need the proxy at all in this simple case.
Regards,
Konstantin Petkov
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0

Rob
Top achievements
Rank 1
answered on 25 Sep 2007, 11:22 AM
Konstantin,
Thanks a lot for your help, that works as requested.
Rob
Thanks a lot for your help, that works as requested.
Rob