Wait for AJAX Postback

2 posts, 0 answers
  1. Jonathan
    Jonathan avatar
    23 posts
    Member since:
    Jan 2012

    Posted 20 Jan 2012 Link to this post

    I have a DropDownExtender that is an ajax postback control.  I believe my script is breaking because the import has not finished and waiting for the first element does not seem to work.  I have found this link:


    From that link I tried entering the following line of code in an existing function by Customizing step in code:

    public bool ActiveAjaxConnections()
        return Actions.InvokeScript<bool>("Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack()");

    However, I get the following errors:
     Line 107: (BC30205) End of statement expected.
     Line 108: (BC30035) Syntax error.
     Line 109: (BC30647) 'Return' statement in a Sub or a Set cannot return a value.
     Line 109: (BC30037) Character is not valid.
     Line 110: (BC30035) Syntax error.
     Line 113: (BC30429) 'End Sub' must be preceded by a matching 'Sub'.

    Here is the code in view class:

      <CodedStep("Wait for Ajax")> Public Sub WaitAjax()
    public bool ActiveAjaxConnections()
        return Actions.InvokeScript<bool>("Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack()");
    End Sub

    What am I doing wrong?
  2. Anthony
    Anthony avatar
    19 posts

    Posted 20 Jan 2012 Link to this post

    Hello Jonathan,

    Are you coding in Visual Basic? All samples from the article you referenced are written in C#. Simply covert the code on our site and plug the result into the code-behind file instead.

    All the best,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top