I have the followwing RadAjaxManager
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<ClientEvents OnRequestStart="javascript: BeforeUpdateLijsten()" />
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="linkButtonToevoegen" EventName="click">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="radGridPercelen" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
<
/telerik:RadAjaxManager>
The javascript function "BeforeUpdateLijsten" needs to be execute before the back end code.
In the function BeforeUpdateLijsten I update the value of a hiddenField and in the back-end code I read the value of this hiddenField. All the code gets executed but in the back-end I get the old value from the hiddenField.
Can anyone tell me why this is happening and how I can solve this?
Thank you!
5 Answers, 1 is accepted
Please review the following online help topic which elaborate on similar matter. Test the provided approach and let us know if this helps.
Greetings,
Maria Ilieva
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Thank you for you're response.
With ResponseScripts as described in the help topic, the code behind will be executed before the javascript. I need the javascript to be executed before the code behind.
With OnRequestStart I get the correct execution order but in the code behind I get the old value of the hiddenField (In the javascript function I set the hiddenfield to another value).
It looks like there is already a part (viewstate?) of the request send when OnRequestStart is executed.
Greetings
Greet
Could you please send us your sample project, which represents this behaviour, via regular support ticket. We will debug it locally and do our best to provide accurate solution for this issue.
Thank you for the cooperation.
Kind regards,
Maria Ilieva
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
var bypass = false;
function OnRequestStart(ajaxControl, eventArgs) {
var eventTarget = eventArgs.EventTarget;
if (((eventTarget.indexOf("btnInsert") >= 0) || (eventTarget.indexOf("btnUpdate") >= 0)) && !(bypass)) {
eventArgs.set_cancel(true);
bypass = true;
saveLinks(); //this is what updates the values
$find("<%=ap1.ClientID%>").ajaxRequestWithTarget(eventTarget, '')
}
bypass = false;
return true;
}