<%@ Page Language="VB" %>

<script runat="server">
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim ws As New localhost.Async()
        Dim myIar As IAsyncResult
        
        myIar = ws.BeginHelloWorld(Nothing, Nothing)
        
        Dim x As Integer = 0
        
        Do Until myIar.IsCompleted = True
            x += 1
        Loop
        
        Label1.Text = "Wynik wywołania metody sieciowej: " & ws.EndHelloWorld(myIar) & _
           "<br>Licznik czasu oczekiwania: " & x.ToString()
    End Sub
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Wywołanie asynchroniczne/title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Label ID="Label1" Runat="server"></asp:Label>
    </div>
    </form>
</body>
</html>
