The Context object is automatically available to Xbasic code that runs on the stand-alone application server and the IIS application server. It has all properties needed to handle an HTTP request and response as well as access to session and security information.
- Context.Request Object
The Context.Request object contains properties and methods available for working with the current HTTP request.
- Context.Response Object
Context.Response object properties and methods.
- Context.Security Object
Context.Security object properties and methods
- Context.Session Object
Context.Session object properties and methods.
Using the Context object is the preferred way to get information about a request, response, or other context of the server since other objects have been deprecated since version 11. Many of the deprecated objects will not work under IIS.
- Pre-Context object
- Context object
The type of HostContext depends on the platform that the code is running under. Under IIS HostContext is of type System.Web.HttpContext and all properties and methods available on that .NET object are available in Xbasic. Under the stand-alone application server HostContext is of type A5AS::A5INETServerIntegration::A5WServerContext. Read Only
Context.HostContextName contains the name of the platform on which the code is running. This will be "IIS" when running on IIS and will be "Alpha Anywhere Application Server" when running on the stand-alone server. Read Only.
Context.Request contains methods and properties for the current HTTP request. Read Only
Context.Response contains methods and properties for the current HTTP response. Read Only
Context.Security contains the methods and properties available for working with security.Read Only.
Context.ServerSoftware contains the product name and version. Read Only.
Example value: Alpha Anywhere Application Server for IIS Development Server/12.0 Build/3816-4723
Context.Session contains the methods and properties available for working with the current session. Read Only.
- ResolveMimeType Method
Returns the MIME type of the given file name.