Sys.Application.add_load(pageLoad);

  function pageLoad()
  {
    Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandler);
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
  }

  function BeginRequestHandler(sender, args)
  {
    $get('HyperLink1').style.visibility = "hidden";
  }

  function EndRequestHandler(sender, args)
  {
    if (args.get_error() != undefined)
    {
      $get('HyperLink1').style.visibility = "visible";
      args.set_errorHandled(true);
    }
  }
