# AxonASP Server

# AxonASP WASM Playground

Loading WASM module...
<% Dim Axon Set Axon = Server.CreateObject("G3AXONLIVE") If Axon.InitPage() Then ' We are handling an async WASM event! If Axon.EventName = "click" Then Dim currentCount currentCount = Axon.GetComponentProperty("btn1", "data-count") If IsEmpty(currentCount) Or currentCount = "" Then currentCount = 0 currentCount = CInt(currentCount) + 1 ' Update internal state Axon.SetComponentProperty "btn1", "data-count", currentCount ' Directly manipulate the DOM via WASM syscall/js! Dim comp Set comp = Axon.GetComponent("btn1") comp.SetStyle "background", "green" comp.SetStyle "color", "white" comp.SetValue "Clicked " & currentCount & " times!" ElseIf Axon.EventName = "ask_name" Then Dim userName userName = InputBox("What is your name?", "AxonASP WASM", "Guest") If userName <> "" Then If MsgBox("Hello " & userName & "! Do you like WebAssembly?", vbYesNo + vbQuestion) = vbYes Then MsgBox "Great! AxonASP loves WASM too." Else MsgBox "Oh, maybe next time!" End If End If End If Axon.EndAsyncResponse() End If ' Initial Page Render Response.Write "<h1>AxonLive in WASM!</h1>" Response.Write "<p>Click the buttons to interact with the AxonASP engine natively in your browser.</p>" Response.Write "<button id='btn1' onclick='dispatchLiveEvent(""btn1"", ""click"")'>Reactive Counter</button> " Response.Write "<button id='btn2' onclick='dispatchLiveEvent(""btn2"", ""ask_name"")'>Interactive Prompts</button>" %>

## Output

## How to use the AxonASP WASM Playground

The AxonASP WASM Playground runs Classic ASP code in the browser through WebAssembly. The page loads wasm_exec.js and axonasp.wasm before enabling the editor run button.

### Add your ASP code

Paste your Classic ASP code inside the editor using standard server-side delimiters such as <% ... %>. You can use Response.Write to render markup, create server objects, and handle events inside the same script.

### Load the WASM module

When the page opens, JavaScript calls WebAssembly.instantiateStreaming(fetch("axonasp.wasm"), go.importObject). After the runtime reports that the module is ready, you can run the current script from the editor.

### Execute the sample

Click Run ASP Code to execute the current content. The output area below the editor shows the rendered result, while the status bar reports whether the WebAssembly module is loading, ready, or in an error state.

### Interactive events

For live UI actions, bind handlers such as onclick="dispatchLiveEvent(...)" and read the event name through Axon.EventName inside the ASP runtime. This keeps browser interactions and server-side logic connected in the same playground.