PDA

View Full Version : how manually pass extra parameters in ajax call rom JavaScript



zikr
Jan 26, 2009, 8:07 PM
Hi,
let say I'm having such server side handler:






protected void MyButton_Click(object sender, AjaxEventArgs e)


{


...


}


and want in it receive some extra parameters through e.ExtraParams. To invoke ajax call from client side, I'm using such call



MyButton.ajaxEvents.click.fn.apply(MyButton, [??????]);


and in place of ?????? want to pass some extra parameters. How can I do that?

Thanks,
Z.

zikr
Jan 27, 2009, 1:00 PM
Any ideas...?

thanks,
Z.

zikr
Jan 27, 2009, 3:56 PM
Seems that found solution myself. Maybe somebody else would be interested.
Have investigated Extjs and Coolite code client side and seems (may be I'm wrong)
that extra parameters could not be passed to call of if they are not defined in ASP AjaxEvents tag



MyButton.ajaxEvents.click.fn.apply(MyButton, [??????]);

because on client side script generation Coolite passes these extra parameters as arguments to function and uses it for server side call. But have found another way how to call that.



Coolite.AjaxEvent.request(
{
extraParams:
{
param1: '121212',
param2: '34567'
},
formProxyArg: "form1",
viewStateMode: "include",
control: menuItem
});


where formProxyArg contains form Id and control contains Control on what we want to fire event. In this example I'm using
menu item and for click does not need to specify action. For example for calling Change event of DateField on server side, this action should be added: action:'Change'.

Mybe I'm missing here something or missunderstood, would be great to hear some comments from gurus.
Thanks.
Z.