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

Passing the eventarg from client side event to page method

1 Answer 94 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 04 Feb 2009, 02:50 PM
I am trying to figure out how I can pass the eventargs coming from the client side OnClientAppointmentMoveEnd event into a page method.  I'm current getting an out of stack space error in my app and never hitting the page method. The enable page methods option on the script manager is set to true.

Javascript

function onClientApptMoveEnd(sender,eventArgs)
{
PageMethods.SaveTask(eventArgs);
}

CSharp in code behind

[WebMethod]
public static void SaveTask(EventArgs e)
{
int x = 0;
}

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 05 Feb 2009, 09:57 AM
Hello Michael,

I am afraid that this is not supported. The eventArgs client-side object does not map to the EventArgs server side one. You should create a more specific version of your method and pass it the required arguments by extracting them from the eventArgs object e.g.

SaveTask (DateTime startTime, DateTime endTime, int id)
{
}

function onClientApptMoveEnd(sender,eventArgs)
{
var app = eventArgs.get_appointment();
     PageMethods.SaveTask(app.get_start(), app.get_end(), app.get_id());
}


Regards,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Scheduler
Asked by
Michael
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or