Link to home
Start Free TrialLog in
Avatar of Lawrence Avery
Lawrence AveryFlag for United States of America

asked on

Asynchronous calls without AJAX

Can you make a Asynchronous call from a asp page without AJAX?
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Can you make a Asynchronous call from a asp page without AJAX?

you can do the Asynchronous call from server end. for example in ASP.NET

Using Asynchronous Methods in ASP.NET 4.5
https://docs.microsoft.com/en-us/aspnet/web-forms/overview/performance-and-caching/using-asynchronous-methods-in-aspnet-45

but not really doing that in ASP....
@ryan - actually, you CAN do it server side in classic asp

check out the WinHttpRequest object to send async requests:

<%
Dim http: Set http = Server.CreateObject("WinHttp.WinHttpRequest.5.1")
Dim url: url = "https://www.siteName.com/....."
Dim data: data = "variableName=value&variableName2=value2&variableName3=value3........."
With http
  Call .Open("POST", url, False)
  Call .SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
  Call .Send(data)
End With

If Left(http.Status, 1) = 2 Then
  'Request succeeded with a HTTP 2xx response, do something...
Else
  'Output error
  Call Response.Write("Server returned: " & http.Status & " " & http.StatusText)
End If
%>

Open in new window

WinHttpRequest is basically AJAX (AJAX uses XMLHttpRequest) so not what OP wants in my opinion
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.