Javascript Callback Confusion

3 posts, 1 answers
  1. David
    David avatar
    87 posts
    Member since:
    Jul 2010

    Posted 27 May 2011 Link to this post

    I was looking at this project and could not understand a part of the javascript.
    There is an asmx file in the project called Authentication. It has a method IsLoggedIn:

    [WebService(Namespace = "")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class Authentication : WebService
        public bool IsLoggedIn()
            return Context.User.Identity.IsAuthenticated;

    In the file ToolTip.aspx, that method is called as such:

    <telerik:RadCodeBlock runat="server" ID="RadCodeBlock1">
        <script type="text/javascript">
        function OnClientBeforeShow(sender, eventArgs)
            Authentication.IsLoggedIn(successfulAuthCallback, failedAuthCallback, eventArgs);        
        function successfulAuthCallback(isLoggedInResult,eventArgs) {
            if (isLoggedInResult != true)           
                // reload the entire page so the Forms Auth will see that the cookie has expired and redirect to login
        function failedAuthCallback(result, eventArgs)        
            alert("Auth Callback failed: Reason -- " + result);        

    My confusion stems from the fact that:
    1. IsLoggedIn has no formal parameters. However, it is being passed 3 parameters.
    2. I cannot see wheresuccessfulAuthCallback is being passed 2 parameters. It has two parameters. But where are they being passed to it.

  2. Answer
    Svetlina Anati
    Svetlina Anati avatar
    2795 posts

    Posted 30 May 2011 Link to this post

    Hello David,

     The callback functions you ask about are actually not passed across the wire, it's just "forwarded" on to the client side callback functions after the call completes. This is how things work in general and it is directly related to RadToolTipManager - more information is available in the net, e.g below:

    Best wishes,
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. DevCraft R3 2016 release webinar banner
  4. David
    David avatar
    87 posts
    Member since:
    Jul 2010

    Posted 31 May 2011 Link to this post

    Thanks Svetlina.

    That blog post did clear it up for me.
Back to Top