websAspDefine | GoAhead WebServer API | GoAhead EMF |
Define an ASP script procedure
#include "webs.h" int websAspDefine(char_t *name, int (*fn)(webs_t wp, char_t *args));
name | Name of ASP command to define |
fn | Pointer to function to call when the script name is invoked in an ASP page |
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.
Returns 0 if successful. Returns -1 on errors.
int outputMyTable(webs_t wp, char_t *args) { websWrite(wp, "Add HTML code to create a table for %s", args); } websAspDefine("outputTable", outputMyTable);