PhuTri,
>How can VFP commands work in ASP? I have seen some demos and documentations from FoxWeb and AFPages, and wonder how they've done it!
What you're seeing with FoxWeb, AFPages or Web Connection is NOT Active Server Pages, but a substitute that's similar. The IIS Internet Server gets a request and hands it off to a special program provided by one of those vendors, instead of to ASP.dll.
The special handler then either reads and executes the VFP code, or hands off the request somehow to a program that you have put together using the vendor's framework.
I've worked mostly with Web Connection, which provides wc.dll to catch the call from IIS. It then messages a VFP program, usually an EXE, that takes the request, runs your VFP code (calling into other COM objects if necessary), and receives HTML or other response types in return. It then passes this back to IIS, which send it on to the user's browser.
Active Server Pages can run code in VBScript or JavaScript, but not VFP, although an ASP can use that script code to call into VFP COM objects.