Active Server Pages (ASP) is Microsoft's core technology for active Web server content. It's
a scripting engine which runs under IIS. Here are its interesting features:
ASP was made as an active content engine for IIS and as such Microsoft built it for NT. On the other hand, for IIS it's the default (non-CGI) method of providing active content. One of the returning irritants with active code is how to integrate the code and the HTML which presents the results of the code. With ASPs, both code and layout are in the same file, which I don't like, but at least the way they're in the same file is easy to work with. Just can't help falling into Microspeak when I think ASP. ASP, like all Microsoft's recent technologies, is ActiveX-object-oriented. If you have ActiveX objects, it's really easy to use ASPs to integrate them with Web applications. The ASP Session object provides a really convenient cookie-based session tracking.
Other platforms The typical ASP scenario, of course, is that you've got IIS on an NT box already, perhaps for political reasons, and you have to get some sort of active application on there. ASP makes it pretty easy. It provides an embedding syntax and a scripting language. VBScript is the default scripting language, and even though Javascript (or even Perl, I understand) can be used as the scripting language for an ASP, nearly everybody uses VBScript.
That scripting concept And in fact VBScript was designed with limitations in mind, from the number of variables you may declare, to the total data size of a script. So conspiracy theory or not, you can only do so much in VBScript.
How to write your own ASP An ASP is just HTML with some extra stuff.OK, so how do we get the server to run some stuff, then? Well, just as you can use a <script> tag to get the browser to run some code, you can use the same tag to tell the server to run code, if you mark it with runat="server" . Personally I find
this rather confusing, as it's difficult to see at a glance whether the script should run on the
server or on the client.
For that reason, instead of that tag syntax, I use the shorthand server-scripting syntax instead. If you enclose any text within <% ... %>, then the enclosed text is considered a server-side script. That's much cooler-looking anyway. The simplest thing to do with a server-side tag is just to write the value of some variable or function call. And one of the simplest function calls is to read something out of the query URL: this can be done with Request("name of query"). For instance, I have a query of the form my.asp?myquery=hi+there -- if my.asp contains this code:
then it will appear like this:
hi thereVBScript The next logical thing to write about would be VBScript and its object model, but I'm not going to do that. VBScript is a neat little language, and it's salient to more than just web programming, so it will (eventually, of course) get its own topic. When and if I have time to write up a topic on it, I'll link it here.
Applications and global.asa
So what? Well, if you include a file in your application directory called
Onwards |
|
Links will be coming whenever I have time to look some good ones up; for Windows programming I don't usually use online resources that often. This has two main reasons: first, I have lots of offline resources instead, and second, I just have never seen much in the way of decent documentation for WinWeb work. But before I get on that soapbox, I'm going to get back to the paying work. |