websAspDefine GoAhead WebServer API GoAhead EMF

Synopsis

Define an ASP script procedure

Prototype

#include "webs.h" 

int websAspDefine(char_t *name, int (*fn)(webs_t wp, char_t *args));

Parameters

name Name of ASP command to define
fn Pointer to function to call when the script name is invoked in an ASP page

Description

websAspDefine creates an ASP JavaScript procedure that can be called from within an ASP page. The function supplied will be called whenever the name procedure is executed in the ASP page. The name must be unique.

The name procedure is provided a wp handle to the browser connection. This can be used to call many other GoAhead WebServer functions. The args parameter includes any script arguments provided in the ASP page when calling the name script.

Return Value

Returns 0 if successful. Returns -1 on errors.

Example

int outputMyTable(webs_t wp, char_t *args)
{
    websWrite(wp, "Add HTML code to create a table for %s", args);
}

websAspDefine("outputTable", outputMyTable);

See Also

JavaScript, Active Server Pages