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

Compiler error on ajaxrequest

4 Answers 98 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Stephen
Top achievements
Rank 1
Stephen asked on 25 Aug 2008, 07:37 AM
Hello,

I am trying to implement a client side ajax request. When I try to put in the server side ajaxrequest handler like this...

<tlrk:RadAjaxManager ID="RadAjaxManager1" OnAjaxRequest="RadAjaxManager1_AjaxRequest" runat="server">

... I get the following error message.

----------------------------------------------------------------
Compiler Error Message: CS0117:
'ASP.default_aspx' does not contain a definition for 'RadAjaxManager1_AjaxRequest'

Source Error:

Line 248: <asp:

Image runat="server" ID="LoadingImage1" ImageUrl="images/loading7.gif" AlternateText="Loading..." />

Line 249: </tlrk:

RadAjaxLoadingPanel>

Line 250: <tlrk:

RadAjaxManager ID="RadAjaxManager1" OnAjaxRequest="RadAjaxManager1_AjaxRequest" runat="server">

Line 251: <AjaxSettings>
----------------------------------------------------------------------

If I remove OnAjaxRequest from the AjaxManager I can see the ajaxrequest happening via client side OnRequestStart and OnResponseEnd functions but there is no call to the server side function.

I'd be grateful for any help on this.

Regards
Steve Lechowicz

4 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 25 Aug 2008, 02:39 PM
Hi Stephen,

Do you have RadAjaxManager1_AjaxRequest defined? Generally AjaxRequest is a server-side event and you will need server-side event handler.

Regards,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Stephen
Top achievements
Rank 1
answered on 25 Aug 2008, 11:42 PM
Hi Vlad,

Yes the function is defined as below...

private

void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e){

Label1.Text =

"RadAjaxCall";

}

-----------------------------------

In the aspx file I have Label1 defined in the updated controls as below....

<tlrk:RadAjaxManager ID="RadAjaxManager1" runat="server">

<ClientEvents OnResponseEnd="ResponseEnd" OnRequestStart="RequestStart"></ClientEvents>

<AjaxSettings>

<tlrk:AjaxSetting AjaxControlID="RadAjaxManager1">

<UpdatedControls>

<tlrk:AjaxUpdatedControl ControlID="FooterTable1" />

<tlrk:AjaxUpdatedControl ControlID="Label1" />

</UpdatedControls>

</tlrk:AjaxSetting>

-------------------------------------------------

Regards
Steve

0
Vlad
Telerik team
answered on 26 Aug 2008, 05:16 AM
Hello Stephen,

The method should be public or at least protected.

Regards,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Stephen
Top achievements
Rank 1
answered on 26 Aug 2008, 06:19 AM
Solved.

Thank you
Tags
Ajax
Asked by
Stephen
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Stephen
Top achievements
Rank 1
Share this question
or