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

RadAjaxManager Online Help Incorrect

3 Answers 153 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Konrad
Top achievements
Rank 1
Konrad asked on 30 Oct 2008, 08:46 PM
I am a C# guy, but I am working on a VB (sigh) project at the moment
and I was trying to follow the code example in the online help (http://www.telerik.com/help/aspnet-ajax/ajax-manager-proxy.html)  for adding a server-side event handler in a page that points to a master page with a RadAjaxManager. 

The example is:
C#
protected void Page_Load(object sender, EventArgs e)
{
   RadAjaxManager manager = RadAjaxManager.GetCurrent(Page);
   manager.ClientEvents.OnRequestStart =
 "onRequestStart";
   manager.ClientEvents.OnResponseEnd =
 "onResponseEnd";
   manager.AjaxRequest +=
 new RadAjaxControl.AjaxRequestDelegate(manager_AjaxRequest);
}

VB.NET
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
Dim manager As RadAjaxManager = RadAjaxManager.GetCurrent(Page)
manager.ClientEvents.OnRequestStart =
 "onRequestStart"
manager.ClientEvents.OnResponseEnd = "onResponseEnd"
manager.AjaxRequest += New RadAjaxControl.AjaxRequestDelegate(manager_AjaxRequest)
End Sub


The C# code works fine, but I really struggled to get the VB code working.
No once again I'm not very famialiar with .NET VB code so I'm not sure if it is just something in my project but I doubt it.

The code that finally compiled was as follows:

Dim radAjaxManager As RadAjaxManager = radAjaxManager.GetCurrent(Page)
        radAjaxManager.ClientEvents.OnRequestStart = "onRequestStart"
        radAjaxManager.ClientEvents.OnResponseEnd = "onResponseEnd"
AddHandler radAjaxManager.AjaxRequest, AddressOf radAjaxManager_AjaxRequest

I hope this helps someone else out that might run into the same problem. ;)

EDIT: I forgot to mention that I am currently using/testing 2008 Q3 1016 Beta



3 Answers, 1 is accepted

Sort by
0
Accepted
Sebastian
Telerik team
answered on 03 Nov 2008, 11:33 AM
Hello Konrad,

Thank you for the remark - it is right on target! The VB.NET section of the help topic will be updated for the next version of the documentation. I updated your Telerik points for the involvement.

Best regards,
Stephen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Wired_Nerve
Top achievements
Rank 2
answered on 23 Feb 2009, 05:46 PM
I am trying this in C# but I am getting a error from Visual Studio 2008, any ideas on this:

In the line:
manager.AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(manager_AjaxRequest); 

the words manager_AjaxRequest are underlined in RED with the tooltip and error message:
THe name 'manager_AjaxRequest' does not exist in the current context...


any ideas?



0
Iana Tsolova
Telerik team
answered on 25 Feb 2009, 09:18 AM
Hi Warren,

Try adding the below method to your code:

protected void manager_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)  
{  
    //handle the ajax request here.   
}  
 

I hope this helps.

Kind regards,
Iana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Ajax
Asked by
Konrad
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Wired_Nerve
Top achievements
Rank 2
Iana Tsolova
Telerik team
Share this question
or