Feb 28, 2011, 4:10 PM
[CLOSED] DirectMethod not working - page lifecycle is fired
From the examples DirectMehtod Overview
I have the following server-side code
Am I missing something or doing something wrong? Or is the Ext.NET demos documentation incorrect?
TIA
When calling a public server-side Method, but default the complete Page lifecycle is executed and the Method has access to all web controls on the Page.
With a 'static' [DirectMethod] the Page lifecycle is not executed and access to the Page WebControls are not possible. This reduces the processing overhead and optimizes performance.
With a 'static' [DirectMethod] the Page lifecycle is not executed and access to the Page WebControls are not possible. This reduces the processing overhead and optimizes performance.
[DirectMethod(ClientProxy=ClientProxy.Ignore)]
public static int GetRegistrationsCount(int personId)
{
return 55; // return const for testing purposes
}
and the following client-side javascript:function GetRegistrationsCount() {
var regCount = -1;
Ext.net.DirectMethod.request("GetRegistrationsCount",
{
success: function(result) { debugger; regCount = parseInt(result, 10); },
params: { personId: globalPersonId }
});
}
but when I call GetRegistrationsCount from a client-side pushbutton event handler:<Click Handler="GetRegistrationsCount();" />
the entire page content is rendered and the directmethod is never called.Am I missing something or doing something wrong? Or is the Ext.NET demos documentation incorrect?
TIA
Last edited by Daniil; Mar 07, 2011 at 9:19 PM.
Reason: Marked as [CLOSED]. No more information was provided.