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

[Solved] How-to: use AjaxRequest synchronously

1 Answer 206 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Søren Hartig
Top achievements
Rank 2
Søren Hartig asked on 02 Apr 2009, 01:10 PM
Dear all,

I'm executing a method using the ajaxRequest from a page that has my page in a iFrame using:

window.frames['myframeID'].ForceSave("0"); 

the javascript in the page loaded in the iFrame is:

 
            function ForceSave(saleID) { 
                 
                var ajaxManager = $find("<%= ajaxManager.ClientID %>"); 
                ajaxManager.ajaxRequest('ForceSave''ForceSave'); 
 
            } 

This will fire the RaisePostBackEvent(System.Web.UI.IPostBackEventHandler source, string eventArgument)
and here I perform what I need.

What I want now is to perform this synchronously... and wait until my method ends and return back a boolean value.

So, I want, in the page, to wait for the completion of the ForceSave call to continue the rest of the script.

Is this possible? How?

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 06 Apr 2009, 02:04 PM
Hi Søren,

The manager cannot be used synchronously however you can achieve the same very easily using standard page methods:
http://www.geekzilla.co.uk/View7B75C93E-C8C9-4576-972B-2C3138DFC671.htm

All the best,
Vlad
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
Ajax
Asked by
Søren Hartig
Top achievements
Rank 2
Answers by
Vlad
Telerik team
Share this question
or